#P6531. [COCI 2015/2016 #1] BALONI
[COCI 2015/2016 #1] BALONI
Description
A sharpshooter wants to shoot down balloons, and each balloon has a height, denoted by .
Because of the balloons’ elasticity, an arrow will drop. After hitting a balloon, the arrow’s height decreases by .
The sharpshooter can shoot an arrow at any height.
Find the minimum number of arrows the sharpshooter needs to shoot.
Input Format
The first line contains one integer .
The next line contains integers .
Output Format
Only one line with one integer, representing the minimum number of arrows the sharpshooter needs to shoot.
5
2 1 5 4 3
2
5
1 2 3 4 5
5
5
4 5 2 1 4
3
Hint
Sample 1 Explanation
First shoot the balloon at height , then shoot the balloon at height .
Constraints and Limits
- For of the testdata, is guaranteed.
- For of the testdata, is guaranteed.
Notes
This problem is worth points.
This problem is translated from Croatian Open Competition in Informatics 2015/2016 Contest #1 T3 BALONI。
Translated by ChatGPT 5
京公网安备 11011102002149号