#K43232. Minimum Initial Projectile Strength

    ID: 27264 Type: Default 1000ms 256MiB

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

S=max(a1,a2,,an)S = \max(a_1, a_2, \dots, a_n)

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.

## sample
5
3 1 4 1 5
5