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

19371번 - Triangle 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB66181634.783%

문제

There are $N$ sticks. The length of the $i$-th stick is $a_i$. You want to choose six sticks and construct two triangles. Each stick should be used as an edge of one of the triangles. Also, the triangles should be non-degenerate.

Compute the maximum possible total length of the six chosen sticks. If two triangles can not be constructed this way, assume the total length is 0.

입력

The first line contains an integer $N$ (1ドル \le N \le 10^5$). The $i$-th of the next $N$ lines contains an integer $a_i$ (1ドル \le a_i \le 10^{15}$).

출력

Print the answer.

제한

예제 입력 1

6
1
1
1
1
1
1

예제 출력 1

6

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2017 > Day 3: Japanese Contest, Head of Republic of Karelia Cup, Round I B번

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

출처

대학교 대회

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

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