Canadian Computing Competition: 1997 Stage 2, Day 1, Problem 2
Earth is being invaded by space aliens. Earth defence forces have rallied a number of anti-spacecraft guns. However, they have a bug in their aiming hardware: initially they are aimed straight up, and this aim can only be adjusted downward.
Thousands of alien craft are streaking towards Earth as we speak -- and yes, some of them are even aimed at Canada. The Earth defence forces must now come into play. Each gun can fire as many shots as necessary, and can be re-fired as often and as quickly as necessary, but only to the same or lower setting. Thus if a spacecraft came in at height
Input Specification
The data will consist of several sets of data. The first line will contain
Output Specification
For each set, output one integer specifying the minimum number of guns required to eliminate EVERY alien craft.
Sample Input
1
10
4
2
3
4
5
3
1
4
2
5
Sample Output
4
Comments