#MTH000000021. Trở lại toán trung cấp (Back to Intermediate Math)
Trở lại toán trung cấp (Back to Intermediate Math)
Back to Intermediate Math
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
You want to cross a river of width metres. The current flows parallel to the bank at speed m/s, while the boat's speed relative to the water is m/s.
There are two objectives:
- Fastest crossing: point the boat perpendicular to the bank so the cross-river component is maximal; the current may carry the boat downstream.
- Shortest path: point the boat upstream just enough that the actual trajectory is perpendicular to the bank.
If these two different crossings are both well-defined, compute the shortest-path time minus the fastest-crossing time. Otherwise report that the value cannot be determined.
Input
One line contains three nonnegative real numbers , , , with .
Output
If two different crossings as described cannot be determined, print
can't determine
Otherwise print the time difference with exactly three digits after the decimal point.
Subtasks
- Subtask 1 (20%): Only cases where two distinct crossings cannot be determined.
- Subtask 2 (30%): are integers and two distinct crossings exist.
- Subtask 3 (50%): Full source domain: , , .
Examples
Input
8 5 6
Output
1.079
Explanation
For , , and , the fastest crossing time is
For the path whose actual trajectory is perpendicular to the bank, the cross-river speed is
Hence that crossing time is
The difference is , which rounds to 1.079.