Right Triangle

All submissions for this problem are available.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Chef taught his brother Chefu about right angled triangle and its properties. Chefu says that he has understood everything about right angled triangles. Chef wants to check learning of his brother by asking the following question "Can you find a right angled triangle whose length of hypotenuse is H and its area is S?"
Chefu is confused how to solve it. I hope you are not. Please solve this by finding a right angled triangle with hypotenuse H and area S. If it not possible to do so, then output 1.
Input
The first line of the input contains a single integer T denoting the number of testcases. T test cases follow.
For each test case, there will be a single line containing two space separated integers H and S.
Output
Output the answer for each testcase in a single line. If it is not possible to find such a triangle, output 1. Otherwise print 3 real numbers corresponding to the lengths of the sides of the triangle sorted in nondecreasing order. Please note that the length of the triangle sides should not differ by more than 0.01 in absolute value from the correct lengths.
Constraints
 1 ≤ T ≤ 10^{5}
 1 ≤ H ≤ 10^{6}
 1 ≤ S ≤ 10^{12}
Example
Input: 4 5 6 6 10 258303 89837245228 616153 77878145466 Output: 3.00000 4.00000 5.00000 1 1 285168.817674 546189.769984 616153.000000
Author:  kingofnumbers 
Tester:  mgch 
Editorial  http://discuss.codechef.com/problems/RIGHTTRI 
Tags  binarysearch, cook71, easy, kingofnumbers 
Date Added:  27052016 
Time Limit:  3 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 