A Vertical Stack of Three Charts
Halewood Reporting builds a trading page: three panels stacked one above another, all sharing the same run of prices — the price itself at the top, the same prices as bars in the middle, and the spread of them at the bottom. Stacking rather than placing them side by side keeps a single left-to-right reading, so a moment in the top panel lines up with the same moment below it. The page footnote counts how much of the run beat its own average.
Task: Print how many prices are strictly above the average of the run. A price landing exactly on the average is not above it and does not count.
Input
The first line holds an integer n, the number of prices. Each of the next n lines holds one price, possibly with decimals. n is at least 1.
Output
One line holding a whole number: how many prices beat the average.
Example:
Input:
4
10
20
30
40
Output:
2
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in