시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 256 MB | 21 | 14 | 11 | 68.750% |
The weightlifting event is up next at the Olympic games, and it’s time to impress your fans! To accomplish your sequence of lift attempts, you have a constant strength S and a decreasing energy reserve E. For each attempt, you may choose any positive (not necessarily integer) weight W. If S ≥ W, the lift succeeds and your energy goes down by Esucc. If S < W, the lift fails and your energy goes down by Efail. You may continue attempting lifts as long as E > 0. If at any point E ≤ 0, you can make no further attempts. Your score is the maximum weight in kg that you successfully lift, or 0 if all attempts failed.
Ideally, you should lift at exactly your strength limit. However, you do not know your strength. You only know that you can definitely lift the 25 kg Olympic bar, and that the maximum conceivable lift adds 100 kg on each side for a total of 225 kg. How close to an optimal score can you guarantee? That is, what’s the smallest d for which you can ensure a score of at least S − d?
The input consists of a single line containing three space-separated integers E, Esucc, and Efail (1 ≤ E, Esucc, Efail ≤ 107).
Print, on a single line, the minimum d, rounded and displayed to exactly 6 decimal places.
1 3 3
112.500000
12 3 3
13.333333
3000 2 3
0.000000