Distinguishing Lines by Style, Not Just Color
Pike Street Studio draws what happened as a solid line and what was predicted as a dashed one. The dashing is not decoration: around one man in twelve cannot separate red from green reliably, decks get photocopied, and projectors wash colour out — and in each case a chart whose two lines differ only in colour becomes one indistinguishable tangle. Line pattern survives all three. The caption counts how often the forecast ran hot.
Task: Print how many points had a forecast strictly above what actually happened. A forecast that landed exactly on the actual figure was not too high and does not count.
Input
The first line holds an integer n, the number of points. Each of the next n lines holds three fields separated by single spaces: the point's label as a whole number, then the actual figure, then the forecast. n is at least 1.
Output
One line holding a whole number: how many forecasts ran high.
Example:
Input:
3
1 10 12
2 20 18
3 30 35
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