eolymp
bolt
Try our new interface for solving problems
Problems

No More Hapalies!

No More Hapalies!

In a far away place, there exists a university called University of Impartiality (UI). This is an imaginary university and you should not connect this fictional one with real universities. Almost all of the students of UI (or at least most of them) are active, creative ones with a bright future. But unfortunately Hapaly was not one of them because he has never tried to make use of his mental power properly. One day at the beginning of a new term, Hapaly went happily to the educational affairs of UI to get a formal certificate of his total average over all of his terms (i.e. weighted sum of all of his course marks) for an official submission to a government office. A woman, sitting behind her desk said angrily to Hapaly: "all of the marks of last term have not been entered into the computer yet and you should go today and come tomorrow". Hapaly thought that it should not be a bad idea to just ask his other educational statistics and make a poor designer of a local ACM/ICPC contest, design a problem to address his problem. "Your total average and your total sum of passed credits (units) before last term (i.e. without last term’s marks) are \textbf{12.02} and \textbf{130} respectively" said the woman to Hapaly while trying to continue her telephone talk. Hapaly remembers his last term’s average and sum of passed credits; he has passed \textbf{14} credits (units) with the average of \textbf{13.05} in his last term. He really needs your help to solve his difficulty to find out his current average. \InputFile The first line of input contains an integer, the number of test cases. Following, there is one line for each test case. Each test case contains four numbers \textbf{T}, \textbf{A}, \textbf{N}, \textbf{M}, which are sum of passed credits before last term (\textbf{0} ≤ \textbf{T} ≤ \textbf{200}), total average before last term (\textbf{0.00} ≤ \textbf{A} ≤ \textbf{20.00}), sum of passed credits of just last term (\textbf{0} ≤ \textbf{N} ≤ \textbf{200}) and the average of just last term of Hapaly (\textbf{0.00} ≤ \textbf{M} ≤ \textbf{20.00}), respectively. All numbers in test cases are separated by one blank character. \OutputFile There should be one line for each test case in output. Each line should contain one floating point number which is the total current average of Hapaly (including last term) to \textbf{2} decimal places.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
0 0.00 0 0.00
Output example #1
0.00