DAPC25-081.Bottle of New Port
Medium · 1 s · 256 MB
- icpc
- dapc
- 2025
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.
Giriş formatı
The input consists of:
• One line with an integer (), the number of days your bottle of new port has remained open.
• One line with two integers and (), the initial volume of alcohol in the bottle and the initial total volume of other liquids in the bottle, both in .
• One line with two integers and (), the evaporation rate of the alcohol and the evaporation rate of the other liquids in the bottle, both in .
It is guaranteed that the bottle is not empty after leaving it open for days ( or ).
Çıxış formatı
Output the alcohol percentage after leaving the bottle open for days.
Your answer should have an absolute or relative error of at most .
Qeyd
Source: Delft Algorithm Programming Contest 2025 · Author: Thore Husfeldt · License: CC BY-SA 4.0 · Original: https://dapc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.
Nümunələr
Giriş #1
2 3 8 1 1
Çıxış #1
14.2857142857143
Giriş #2
5 11 89 2 1
Çıxış #2
1.17647058823529
Giriş #3
10 10 40 1 1
Çıxış #3
0
Giriş #4
10 40 10 0 3
Çıxış #4
100