#K43232. Minimum Initial Projectile Strength
Minimum Initial Projectile Strength
Minimum Initial Projectile Strength
You are given n balloons, each with a certain strength requirement that determines the minimum strength needed to pop it. The projectile you launch must have an initial strength that is high enough to pop all the balloons. In other words, you need to choose an initial strength S such that
where a_i
is the strength requirement of the i-th balloon. Your task is to compute and output this minimum initial strength.
inputFormat
The input is given in two lines:
- The first line contains an integer n, the number of balloons.
- The second line contains n space-separated integers representing the strength requirements of each balloon.
outputFormat
Output a single integer: the minimum initial strength required to pop all balloons, which is equivalent to the maximum value among the provided strengths.
## sample5
3 1 4 1 5
5