P1258 The Small Car Problem
Description
Two people, Jia and Yi, start from point A at the same time and want to arrive at point B simultaneously as quickly as possible. At the departure time, there is a car at A, but this car can carry only one passenger in addition to the driver. It is known that Jia and Yi have the same walking speed, and it is less than the car’s speed. How should the car be used so that both arrive at point B at the same time as quickly as possible?
Input Format
A single line with three real numbers, representing the distance $s$ between points A and B, the walking speed $a$, and the car’s speed $b$.
Output Format
The minimum time for both to arrive at point B simultaneously, rounded to $6$ decimal places.
Explanation/Hint
Constraints
For $100\%$ of the testdata, it is guaranteed that $0 \leq s, a, b \leq 10^9$.
Translated by ChatGPT 5