#BS0000320. Đo lượng mưa (Rain Fall)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Đo lượng mưa (Rain Fall)
Rain Fall
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem Statement
An initially empty rain gauge cannot overflow. A leak at height drains water at rate whenever the level exceeds . Rain falls at a constant unknown rate for hours; hours after it stops the observed level is . Ignore evaporation and the size of the leak. Find the minimum and maximum total rainfall compatible with the observation.
Input
One line contains five decimal numbers in that order: the leak height (mm), leakage rate (mm/hour), rain duration (hours), time elapsed after the rain stops (hours), and observed water level (mm). Each number has exactly two digits after the decimal point.
Output
Print the minimum and maximum rainfall. Each value is accepted if its absolute or relative error is less than .
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): .
Examples
Input 1
80.00 0.50 2.00 1.50 80.00
Output 1
80.000000000 80.759403280
Explanation
Without leakage rainfall is 80 mm. With leakage the excess can drain back to the leak level; the maximum is approximately 80.759403 mm.
Input 2
150.00 1.00 100.00 150.00 100.00
Output 2
100.000000000 100.000000000
Explanation
The level is below the leak, so no water was lost.