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

21627번 - Ice Cream 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB145302118.103%

문제

Recently Makar has got $n$ ice cream cones as a gift, the $i$-th of them contains $a_i$ grams of the ice cream. He has decided to eat all of them today.

Before starting to eat, Makar takes the ice cream out of the freezer, so at the same moment the ice cream in each cone starts to melt. Each cone of ice cream is continuously melting at a rate of $v$ grams per second. Makar never eats the melted ice cream, and it doesn't bothers him in any way: you can assume that the ice cream melts from the bottom, and Makar eats it from the top. Makar eats ice cream continuously at a rate of $u$ grams per second. Makar can eat only from one cone at a time. But he can start with any cone and at any moment he can switch from one cone to another, switching takes no time.

Once started, Makar will continue eating until there's no ice cream left. But Makar knows that eating a lot of ice cream is unhealthy! Therefore, he wants to eat ice cream in a way that minimizes the total weight of the ice cream eaten.

Help Makar! Output the minimum total weight of ice cream that he can eat under the given conditions.

입력

The first line contains three integers $n,ドル $v,ドル $u$ --- the number of ice cream cones, the melting rate and the rate of eating ice cream (1ドル\le n\le 3\cdot10^5,ドル 1ドル\le v,u \le 10^9$).

The second lines contains $n$ integers $a_i$ (1ドル\le a_i \le 10^9$) --- weight of ice cream in grams in each of the cones.

출력

Output a single real number --- the minimum weight of the ice cream that can be eaten by Makar.

Your answer will be considered correct if its absolute or relative error doesn't exceed 10ドル^{-6}$.

제한

예제 입력 1

1 1 2
90

예제 출력 1

60.000000

예제 입력 2

2 1 1
30 20

예제 출력 2

16.666667

힌트

In the first test case, Makar eats ice cream for 30 seconds. During this time he manages to eat 60 grams and 30 grams melt, after that there is no ice cream left.

In the second test case, the optimal order is to eat from the second cone during first $\frac{10}{3}$ seconds and then eat from the first cone during next $\frac{40}{3}$ seconds.

출처

Olympiad > Russian Olympiad in Informatics > Russia High School Programming Contest > Russia High School Programming Contest 2020 G번

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

출처

대학교 대회

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

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