#t379. 拦截导弹(missile)
拦截导弹(missile)
Missile Interception
Problem Background
Special for beginners, ^_^
Problem Description
To defend against enemy missile attacks, a country developed a missile interception system. However, this system has a flaw: while its first shell can reach any altitude, every subsequent shell cannot fly higher than the previous one. One day, radar detected incoming enemy missiles. Because the system is still in trial, there is only one system, so it may not be able to intercept all missiles.
The radar reports the incoming heights (positive integers not greater than , at most missiles). Compute the maximum number of missiles this single system can intercept, and the minimum number of such systems needed to intercept all missiles.
Input Format
A single line with several integers — the incoming heights in order.
Output Format
The first line contains one integer — the maximum number of missiles that can be intercepted.
The second line contains one integer — the minimum number of systems needed to intercept all missiles.
Sample Input
389 207 155 300 299 170 158 65
Sample Output
6
2
Constraints
Missile heights are positive integers ; number of missiles .
Time limit 1s, memory limit 1024KiB for each test case.