Andrew recently bought a special car, which has two engines. He can use both engines of the car or only one of the two engines.
If he uses only the first engine, the car would move at the speed v1.
If he uses only the second engine, the car would move at the speed v2.
But if the car uses both engines, it would move at speed v = v1 + v2.
He wants to travel from Iasi to Cluj-Napoca to reach the final round of MindCoding. For this purpose, he did some benchmarks and found that if he uses only the first engine, he would traverse the distance between the two cities in t1 minutes (you may consider that the car moves with a constant velocity v1) and if he uses only the second engine, the car would traverse this distance in t2 minutes (you may consider that the car moves with a constant velocity v2). Because none of these times are small enough to arrive before the start of the contest in Cluj-Napoca, Andrew decided to use both engines.
But just before leaving, a friend specialized in mechanics helped him to improve his engine power. He increased the power of the first engine k1 times and the power of the second one k2 times. Thus, the new speed of the first engine will be v1*k1, and the second one's speed will be v2*k2. Now with both engines he can travel the distance from Iasi to Cluj-Napoca with speed v1*k1 + v2*k2, but he doesn't know how to compute the time needed for him to arrive at the destination.
Your task is to compute that time, knowing only t1, t2 and k1, k2.
The first line of input contains four integers t1, k1, t2, k2, in this order, separated by spaces.
The only line of output should contain the needed time to arrive at the destination, travelling with speed v1*k1 + v2*k2.
- 1 ≤ v1, v2, k1, k2 ≤ 100
- Your result is tested agains ours. Your output will be correct if the absolute value between our answer and your answer is ≤ 0.0001
|5 5 20 20||0.5|