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

17550번 - Inquiry I 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 (추가 시간 없음) 512 MB35722818262.116%

문제

The Bureau for Artificial Problems in Competitions wants you to solve the following problem: Given \(n\) positive integers \(a_1, \dots , a_n\), what is the maximal value of

\(\left(a_1^2 + \cdots + a_k^2 \right) \cdot \left( a_{k+1} + \cdots + a_n \right)\)?

입력

  • A single line containing an integer 2 ≤ \(n\) ≤ 106.
  • Then follow \(n\) lines, the \(i\)th of which contains the integer 1 ≤ \(a_i\) ≤ 100.

출력

Output the maximal value of the given expression.

제한

예제 입력 1

5
2
1
4
3
5

예제 출력 1

168

예제 입력 2

2
1
1

예제 출력 2

1

예제 입력 3

10
8
5
10
9
1
4
12
6
3
13

예제 출력 3

10530

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2019 Preliminaries I번

  • 문제를 만든 사람: Onno Berrevoets
(追記) (追記ここまで)

출처

대학교 대회

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

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