시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 17 | 13 | 13 | 81.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 | 30 | N < 10 |
2 | 70 | N ≤ 200 |
4 2 4 5 7
5