시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB111554351.190%

문제

At the Bottles and Port Company, you produce and bottle only the finest of vintages. To satisfy the desires of your highly exclusive clientele, it is necessary to study what happens to your wines once a new bottle is opened. When that happens, liquids in the bottle immediately start evaporating. The alcohol in the bottle evaporates at a different rate than the other liquids in the bottle, meaning that over time, the delicate balance of the port wine will be disturbed.

Your goal is to compute how the alcohol percentage changes in the days after opening a fresh bottle. By placing the opened bottle in an advanced chemical apparatus, you are able to measure how fast each liquid in the bottle evaporates.

입력

The input consists of:

  • One line with an integer $d$ ($0\leq d\leq 10^6$), the number of days your bottle of new port has remained open.
  • One line with two integers \(a\) and \(o\) (\(1\leq a, o\leq10^{12}\)), the initial volume of alcohol in the bottle and the initial total volume of other liquids in the bottle, both in \(\text{µL}\).
  • One line with two integers \(\Delta_{a}\) and \(\Delta_{o}\) (\(0\leq\Delta_{a}, \Delta_{o}\leq10^{12}\)), the evaporation rate of the alcohol and the evaporation rate of the other liquids in the bottle, both in \(\text{µL/day}\).

It is guaranteed that the bottle is not empty after leaving it open for $d$ days (\(d \cdot \Delta_{a} < a\) or \(d \cdot \Delta_{o} < o\)).

출력

Output the alcohol percentage after leaving the bottle open for $d$ days.

Your answer should have an absolute or relative error of at most $10^{-6}$.

예제 입력 1

2
3 8
1 1

예제 출력 1

14.2857142857143

예제 입력 2

5
11 89
2 1

예제 출력 2

1.17647058823529

예제 입력 3

10
10 40
1 1

예제 출력 3

0

예제 입력 4

10
40 10
0 3

예제 출력 4

100

출처

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

  • 문제를 만든 사람: Thore Husfeldt