Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …
Problems
#861

~/algor $ cat problems/bR94CPbPGrdG

A bird between two trains

Hidden (link only)
Medium 1000 ms 64 MB 40%
Share

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?

Two trains moving towards each other at v1 and v2, the distance S, and the path of a bird flying between them at v

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

Input #1
120 40 20 90
Output #1
180.00
Input #2
100 30 40 60
Output #2
85.71

Sign in to submit a solution

Signing up is free and takes a minute.