~/algor $ cat problems/bR94CPbPGrdG
A bird between two trains
Hidden (link only)Two trains leave two cities km apart at the same moment and move towards each other: the first at km/h, the second at km/h. At that moment a bird starts from the first train towards the second at km/h. On reaching the second train it turns back to the first one at once, and it keeps flying between them until the trains meet. How many kilometres does the bird fly in total?
Input
One line contains four positive integers: , , and .
Output
One number — the distance the bird flies (km), with exactly 2 digits after the decimal point (for example, 1.44).
Note
Examples
120 40 20 90
180.00
100 30 40 60
85.71