RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00650

Zastave

Unrated 레이팅 미적용
난이도
1s
시간 제한
512MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

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!

제약

Subtask
Constraints
Restrictions
1
41
\(n \le 100\)
2
22
\(n \le 1000\)
3
47
No additional constraints.

입력 형식

The first line contains the integers \(n\) and \(S\) (\(1 \le n \le 100\,000\), \(1 \le S \le 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@@RISE_MATH_BLOCK_0@@i \le 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}.

예제 1
입력
2 3
4 5
출력
6.5200982141
예제 2
입력
1 6
10
출력
24.0000000000
예제 3
입력
4 7
5 5 6 6
출력
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.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2022/2023 Contest 5

평가 및 의견

Zastave

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Zastave

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8