#K3156. Minimum Common Element

    ID: 24896 Type: Default 1000ms 256MiB

Minimum Common Element

Minimum Common Element

You are given an array of n integers. In order to make all elements equal, you can only increase the smaller elements. Thus, the minimum possible common value that all elements can be raised to is the maximum value in the original array. In other words, if the array is \(a_1, a_2, \ldots, a_n\), the answer is \(\max\{a_1, a_2, \ldots, a_n\}\).

Your task is to compute and output this value.

inputFormat

The first line contains an integer n, the number of elements in the array. The second line contains n space-separated integers representing the array.

outputFormat

Output a single integer, which is the minimum common value possible after performing the operations (i.e., the maximum element in the original array).

## sample
4
1 2 3 4
4