mean

Time limit: 0.05s Memory limit: 256MB Input: Output:

George loves informatics very much, but he is only a beginner and therefore he needs your help.

In the informatics class the teacher writes on the board NN integers and George should make several operations. An operation consists in choosing two adjacent integers and replace them with a single number, equal to the integer part of their arithmetic mean. For example, 77 and 99 are replaced with 88, 77 and 1212 with 99, 101101 and 102102 with 101101. George should make these operations until there will be only one integer on the board.

Task

Help George find out what is the greatest number which can be obtained in the end.

Input data

The first line of the input contains one integer NN, representing the number of integers written on the board.

The second line of the input contains NN integers a1,a2,ana_1, a_2, \dots a_n, the numbers written on the board at the beginning.

Output data

The first line of the output contains one integer, the greatest number that can be obtained in the end, after all the operations are made.

Constraints and clarifications

  • 1N2001 \leq N \leq 200
  • 1ai1 000 000 0001 \leq a_i \leq 1 \ 000 \ 000 \ 000, for ii from 11 to NN
# Points Constraints
1 30 N<10N \lt 10
2 70 No additional constraints

Example

stdin

4
2 4 5 7

stdout

5

Explanation

Initial numbers written on the board: 2 4 5 72 \ 4 \ 5 \ 7

Replace the elements on the positions 22 and 33: 2 4 72 \ 4 \ 7

Replace the elements on the positions 11 and 22: 3 73 \ 7

Replace the elements on the positions 11 and 22: 55

Log in or sign up to be able to send submissions!