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

27912번 - Zastave 서브태스크스페셜 저지다국어

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

문제

After an exhausting day of preparing COCI, after sleeping for only three hours and in intervals of 20ドル$ minutes, and finally after naughty Patrick and Josip got on his nerves, Vito fell asleep.

Vito was always a pacifist and as a sign of his resignation in front of the disobedience of his (un)reliable friends, Vito dreamed of $n$ white flags. The white flags had the shape of a right triangle swirling in the air with one of their sides parallel to the ground. In the morning, Vito could only remember a few key details... the length of the hypotenuse of the $i$-th flag was $r_i$ and the total sum of heights of the flags was at most $S$.

Now awake, he decided he shall fight on the beaches and never surrender! He rushed to the nearest paint shop so that next time he dreams of the $n$ white flags he can paint them over! But he quickly realized, he isn’t sure how much paint he has to buy. So he asked you to calculate the maximum possible total area of the $n$ white flags satisfying the constraints!

입력

The first line contains the integers $n$ and $S$ (1ドル ≤ n ≤ 100,000円,ドル 1ドル ≤ S ≤ 10^{10}$), the number of flags and the maximum possible sum of heights of the flags.

In the next line there are $n$ integers $r_i$ (1ドル ≤ r_i ≤ 100,000円$).

출력

In the only line, output the maximum possible sum of areas of the flags. Your solution will be considered correct if the absolute or relative error is smaller than 10ドル^{-6}$.

제한

서브태스크

번호배점제한
141

$n ≤ 100$

222

$n ≤ 1000$

347

No additional constraints.

예제 입력 1

2 3
4 5

예제 출력 1

6.5200982141

예제 입력 2

1 6
10

예제 출력 2

24.0000000000

예제 입력 3

4 7
5 5 6 6

예제 출력 3

18.5706715170

힌트

Clarification of the second example The largest possible area is achieved by a flag with sides 6ドル,ドル 8ドル,ドル and 10ドル$ and the total area is 24ドル$.

출처

Contest > Croatian Open Competition in Informatics > COCI 2022/2023 > Contest #5 5번

채점 및 기타 정보

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

출처

대학교 대회

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

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