Brother Outing Problem time limit: 3000 ms | Memory limit: 65535 KB Difficulty: 2 Describe the two brothers cycling outing, the younger brother first set out, every minute x meters, m minutes after the brother with a dog to start. To the speed of Y meters per minute chasing younger brother, and the dog at Z-meter per minute speed to the younger brother ran, after the younger brother and immediately returned, until brother catch up with his brother, the dog ran how many meters. Enter the first line to enter an integer N representing the number of groups of test data (n<100)
One row for each set of test data, four positive integers, respectively, for the M,X,Y,Z (data guarantee x<y<z) output the path of the dog run, the result is reserved two digits after the decimal point. Sample input
1
5 10 15 20
Sample output
200.00
# include<stdio.h>
int main ()
{
int n,m,x,y,z;
scanf ("%d", &n);
while (n--)
{
scanf ("%d%d%d%d", &m,&x,&y,&z);
printf ("%.2lf\n", m*x*z*1.0/(Y-x));
}
return 0;
}