시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB17131381.250%

문제

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 N 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, 7 and 9 are replaced with 8, 7 and 12 with 9, 101 and 102 with 101. George should make these operations until there will be only one integer on the board.

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

입력

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

The second line of the input contains N integers a1, a2, ..., an, the numbers written on the board at the beginning.

출력

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.

제한

  • 1 ≤ N ≤ 200
  • 1 ≤ ai ≤ 1,000,000,000, for i from 1 to N

서브태스크

번호배점제한
130

N < 10

270

N ≤ 200

예제 입력 1

4
2 4 5 7

예제 출력 1

5
  • Initial numbers written on the board : 2 4 5 7
  • Replace the elements on the positions 2 and 3 : 2 4 7
  • Replace the elements on the positions 1 and 2 : 3 7
  • Replace the elements on the positions 1 and 2 : 5

채점 및 기타 정보

  • 예제는 채점하지 않는다.