NOIP '99 P1 - Missile Interception

View as PDF

Submit solution

Points: 12 (partial)
Time limit: 1.0s
Memory limit: 64M

Problem types

To defend against the enemy's missile attacks, a country has developed a missile interception system. Each shell can fire as many times as necessary, but only to the same or lower setting. One day, the radar found incoming missiles from an enemy country. Since the system is still in the trial stage, there is only one system, so it may not be possible to intercept all missiles.

Given the altitude of the missiles (the altitude found by the radar is a positive integer in the range \le 50\,000), calculate the maximum number of missiles this system can intercept and the minimum number of this missile interception system required to intercept all missiles.

Input Specification

There is one line of input, the altitude of the missiles. (There will be at most 2000 numbers on this line).

Output Specification

There should be two lines of output. The number on the first line indicates the maximum number of missiles the system can intercept, and the number on the second line indicates the minimum number of such missile interception systems required to intercept all missiles.

Sample Input

389 207 155 300 299 170 158 65

Sample Output

6
2

Problem translated to English by Tommy_Shan.


Comments

There are no comments at the moment.