Bicycle Race

Problem #68

Tags: mathematics physics

Who solved this?

Also available in: Russian

two cyclists

Two bicyclist start moving from different cities heading to meet each other somewhere in the middle (not exactly since they travel with different speed).

The road is laid in straight line between two cities.

You will be given the distance between cities S (in kilometers) and speed values for two bicyclists (A and B in kilometers per hour). Your task is to find their meeting point (its distance from the first of cities).

Input data will have the number of test-cases in the first line.
Next lines will contain three values each S A B.
Answer should contain the distances between first city and rendezvous point (i.e. distance travelled by first cyclist before they meet), separated with spaces.


input data:
10 1 1
20 1 2

5 6.66666667

Note: the floating point values should have precision 10e-7 or better

You need to login to get test data and submit solution.