BABA1 - ARE YOU GOOD IN MATHS?

BABA taught properties of right angled triangle and asked a questions: "Can you find a right angled triangle whose length of hypotenuse is H and its area is A?"

INDIAN students can answer quickly.

Input

The first line of the input contains a single integer T (where 1 ≤ T ≤ 10^5) denoting the number of test-cases. T test cases follow.

For each test case, there will be a single line containing two space separated integer H and A (where 1 ≤ H ≤ 10^6 and 1 ≤ A ≤ 10^12).

Output

Output the answer for each test-case 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 non-decreasing order.

NOTE: give your answer with 6 decimal places.

Example

Input:
4
24252 56578987908
1 1
2 2
10 10

Output:
-1
-1
-1
2.043096 9.789063 10.000000

Added by:junior_g
Date:2017-02-14
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ADA95 ASM32-GCC ASM32 ASM64 BASH BC BF COBOL COFFEE D-CLANG D D-DMD DART ELIXIR ERL FANTOM FORTH FORTRAN CHICKEN

hide comments
2018-06-20 09:21:07
simple math ..but take,sf,pf & print double i got 3 WA !! then AC
2017-10-01 23:49:20
yup,no binary search required
2017-09-13 10:43:29
No Binary Search required!!
Simple geometry!!
2017-08-26 11:58:16
You can solve it without binary search

But to do it you should exploit some much more complex ideas

I can't prove why formula for finding roots of square equation is correct

But I can prove that you can find root of square equation using numerical calculations
2017-08-23 21:11:04
Use printf instead of cout to print the double output
2017-05-28 08:59:29
Binary Search Tag is misleading! Not required at all
2017-02-15 10:17:40
kindergarten mathematics...

Last edit: 2017-02-15 17:30:32
2017-02-15 09:34:55
No binary search required.

Last edit: 2017-02-15 19:01:37
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.