Logo
(追記) (追記ここまで)

21957번 - Mean 서브태스크다국어

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

문제

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

힌트

출처

Contest > infO(1) Cup > infO(1) Cup 2019 National Round 3번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /