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

23365번 - Buffered Buffet 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB1491059370.992%

문제

Finally, you are allowed again to invite your friends over for a delicious buffet! However, you still need to take social distancing measures into account. To complicate matters further, your friends are coming from various different countries. Each of these countries has slightly different social distancing rules. For example, your friends from the US are required to sit at least 2ドル$ meters from another person, while your friends from France only need to sit 1ドル$ meter apart from others.

You would like for all your friends to sit around one large circular table. You want to position your friends at this table in such a way that everyone complies with the social distancing requirements of their respective country. To make matters a bit easier, the distance between two people sitting at the table is calculated along the circumference. What is the minimum circumference of the table such that everyone can comply with their social distancing requirement?

입력

The input consists of:

  • One line containing an integer $n$ (2ドル \le n \le 10^{5}$), the number of people sitting at the table (yourself included).
  • One line containing $n$ integers $d_1, \dots, d_n$ (1ドル \le d_i \le 10^{9}$), how many meters each person needs to sit apart from others (measured along the circumference of the table).

출력

Output the minimum circumference of the table in meters such that everyone can sit at the table while respecting their social distancing measures.

제한

예제 입력 1

2
2 3

예제 출력 1

6

예제 입력 2

3
2 2 3

예제 출력 2

8

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2021 Preliminaries B번

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

출처

대학교 대회

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

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