Limits 1s, 512 MB

You are given a right triangle ABCABC where angle ABCABC is the right angle and BDBD is perpendicular to ADAD. The values of ABAB and BCBC are given in the input. All you need to do is finding out the value of x2+yzz2{x}^{2} + {yz} - {z}^{2}. Can you do the easiest job here? Yes, you can. I have firm faith on you.


First line will contain an integer TT (1T5001 \le T \le 500), the number of test cases and the following TT lines will contain exactly two integers ABAB, BCBC (1AB,BC10000000001 \le AB, BC \le 1000000000).


You have to print a number for every test case in a separate line which denotes the value of x2+yzz2{x}^{2} + {yz} - {z}^{2}. Your answer will be considered as correct if its absolute or relative error does not exceed 10610^{-6}.

Formally, let your answer be aa, and jury's answer be bb, your answer is accepted if and only if abmax(1,b)<=106\frac{|a-b|}{max(1, |b|)} <= {10}^{-6} .


5 5
9 12



Login to submit.


85% Solution Ratio
Tawsifiit48Earliest, Dec '20
rajin_siamFastest, 0.0s
Tawsifiit48Lightest, 131 kB
Nusab19Shortest, 102B
Toph uses cookies. By continuing you agree to our Cookie Policy.