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 test-cases. 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 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. 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 ≤ 105
- 1 ≤ H ≤ 106
- 1 ≤ S ≤ 1012

-----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

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
import math
t = eval(input())
while t > 0:
	(h, s) = input().split()
	h = int(h)
	s = int(s)
	if h * h * h * h - 16 * s * s < 0:
		print('-1')
	else:
		B = math.sqrt(h * h + math.sqrt(h * h * h * h - 16 * s * s)) / math.sqrt(2)
		P = 2 * s / B
		if B > P:
			print('{0:.6f}'.format(P), '{0:.6f}'.format(B), '{0:.6f}'.format(h))
		else:
			print('{0:.6f}'.format(B), '{0:.6f}'.format(P), '{0:.6f}'.format(h))
	t = t - 1


import math
for i in range(int(input())):
	(h, a) = list(map(int, input().split()))
	cv = 4 * a / h ** 2
	if cv > 1:
		print(-1)
	else:
		thita = math.asin(cv) / 2
		ratio = math.tan(thita)
		hh = math.sqrt(2 * a / ratio)
		b = 2 * a / hh
		m = max(b, hh)
		s = min(b, hh)
		print('%0.5f %0.5f %0.5f' % (s, m, h))


from math import sqrt
from math import pow
t = int(input())
while t > 0:
	t = t - 1
	(h, s) = list(map(int, input().split()))
	s2 = pow(s, 2)
	h4 = pow(h, 4)
	s216 = s2 * 16
	sq2 = h4 - s216
	if sq2 < 0:
		print('-1')
		continue
	sq = sqrt(sq2)
	hpsq = pow(h, 2) + sq
	a2 = hpsq / 2
	a = sqrt(a2)
	b2 = pow(h, 2) - a2
	b = sqrt(b2)
	if a < b:
		print(str(a) + ' ', str(b) + ' ', str(h) + ' ')
	else:
		print(str(b) + ' ', str(a) + ' ', str(h) + ' ')


t = int(input())
for i in range(t):
	(h, s) = list(map(int, input().split()))
	d = h ** 4 - 16 * s * s
	if d < 0:
		print('-1')
	else:
		d = d ** 0.5
		r1 = (h ** 2 + d) / 2
		r2 = (h ** 2 - d) / 2
		if r1 < 0 or r2 < 0:
			print('-1')
		else:
			arr = []
			r1 = r1 ** 0.5
			r2 = r2 ** 0.5
			arr.append(r1)
			arr.append(r2)
			arr.append(h)
			arr.sort()
			print('%.6f' % arr[0], '%.6f' % arr[1], '%.6f' % arr[2])


t = int(input())
for test in range(t):
	(h, s) = list(map(int, input().split()))
	if h ** 2 >= 4 * s:
		x = (h ** 2 + 4 * s) ** 0.5
		y = (h ** 2 - 4 * s) ** 0.5
		res = list(map(float, sorted([h, (x + y) / 2, (x - y) / 2])))
		print('%.5f %.5f %.5f' % (res[0], res[1], res[2]))
	else:
		print(-1)


import math
tt = int(input())
for i in range(tt):
	(h, s) = list(map(int, input().split()))
	a = h ** 2 + 4 * s
	b = math.sqrt(a)
	u = h ** 2 - 4 * s
	if u < 0:
		print(-1)
		continue
	k = (b + math.sqrt(h ** 2 - 4 * s)) / 2
	m = b - k
	g = [h, k, m]
	g.sort()
	print(' '.join(map(str, g)))


from math import sqrt, pow
t = int(input())
while t > 0:
	(h, s) = list(map(int, input().split()))
	if pow(h, 2) + 4 * s >= 0 and pow(h, 2) - 4 * s >= 0:
		a = (sqrt(pow(h, 2) + 4 * s) + sqrt(pow(h, 2) - 4 * s)) / 2
		b = sqrt(pow(h, 2) + 4 * s) - a
		if a > 0 and b > 0:
			c = []
			c.append(a)
			c.append(b)
			c.append(h)
			c.sort()
			for i in c:
				print(i, end=' ')
			print(' ')
		else:
			print(-1, end=' ')
	else:
		print(-1)
	t -= 1


import math
t = eval(input())
while t > 0:
	t -= 1
	(h, s) = list(map(int, input().split()))
	try:
		bplush = math.sqrt(h * h + 4 * s)
		bminush = math.sqrt(h * h - 4 * s)
		base = (bplush + bminush) / 2
		height = (bplush - bminush) / 2
		a = [base, height, h]
		a.sort()
		for i in a:
			print(float(i), end=' ')
		print()
	except:
		print('-1')


import math
from decimal import *
T = int(input())
while T > 0:
	(h, a) = list(map(int, input().split()))
	x = h * h * h * h - 16 * a * a
	if x < 0:
		print(-1)
	else:
		y = 0.5 * h * h - 0.5 * math.sqrt(x)
		if y < 0:
			print(-1)
		else:
			s = math.sqrt(0.5 * h * h - 0.5 * math.sqrt(x))
			b = h * h - s * s
			ans = []
			ans.append(s)
			ans.append(math.sqrt(b))
			ans.append(h)
			new_list = []
			for item in ans:
				new_list.append(float(item))
			ans.sort()
			print(format(ans[0], '.6f'), format(ans[1], '.6f'), format(ans[2], '.6f'))
	T -= 1


from math import sqrt
from sys import stdin

def solution(h, s):
	sqrt1 = h ** 4 - 16 * s ** 2
	if sqrt1 < 0:
		return False
	sqrt2 = h ** 2 - sqrt(sqrt1)
	if sqrt2 < 0:
		return False
	sqrt2 = sqrt(sqrt2 / 2)
	sqrt3 = h ** 2 + sqrt(sqrt1)
	sqrt3 = sqrt(sqrt3 / 2)
	return [sqrt2, sqrt3]
t = int(stdin.readline())
while t > 0:
	t -= 1
	(h, s) = list(map(int, stdin.readline().split()))
	answer = solution(h, s)
	if answer == False:
		print(-1)
	else:
		answer.append(h)
		answer = sorted(answer)
		for i in answer:
			print(i, end=' ')
		print()


import math
t = int(input())
while t > 0:
	(h, s) = list(map(int, input().split()))
	check = h * h - 4 * s
	if h * h >= 4 * s:
		det = math.sqrt(h * h * h * h - 16 * s * s)
		a = (h * h + det) / 2
		a = math.sqrt(a)
		b = (h * h - det) / 2
		b = math.sqrt(b)
		if a < b:
			print('%f %f %f' % (a, b, h))
		else:
			print('%f %f %f' % (b, a, h))
	else:
		print('-1')
	t -= 1


import cmath
from math import ceil, floor, sqrt

def float_round(num, places=0, direction=floor):
	return direction(num * 10 ** places) / float(10 ** places)
t = int(input())
a = float(1)
for i in range(t):
	s = list(map(int, input().split()))
	b = float(pow(s[0], 2))
	c = float(4 * pow(s[1], 2))
	d = float(b ** 2 - 4 * a * c)
	if d == 0:
		sol1 = abs((b - cmath.sqrt(d)) / (2 * a))
		m = []
		m.append(float_round(sqrt(sol1), 6, round))
		m.append(float_round(sqrt(b - sol1), 6, round))
		m.append(float_round(sqrt(b), 6, round))
		m.sort()
		for p in range(2):
			print(m[p], end=' ')
		print(m[2])
	elif d > 0:
		sol1 = abs((b - cmath.sqrt(d)) / (2 * a))
		sol2 = abs((b + cmath.sqrt(d)) / (2 * a))
		m = []
		m.append(float_round(sqrt(sol1), 6, round))
		m.append(float_round(sqrt(sol2), 6, round))
		m.append(float_round(sqrt(b), 6, round))
		m.sort()
		for p in range(2):
			print(m[p], end=' ')
		print(m[2])
	else:
		print(-1)


import math
t = eval(input())
for i in range(t):
	b = []
	(h, s) = list(map(int, input().split()))
	a = math.pow(h, 4) - 16 * s * s
	if a < 0:
		print('-1')
	else:
		ans = math.sqrt(a)
		answe = (h * h + ans) / 2
		answe2 = (h * h - ans) / 2
		if answe > 0:
			b.append(math.sqrt(answe))
			b.append(2 * s / b[0])
		b.sort()
		print(str(b[0]) + ' ' + str(b[1]) + ' ' + str(h))


import math
try:
	t = eval(input())
except EOFError:
	t = 0
while t:
	try:
		(h, s) = list(map(int, input().split()))
	except EOFError:
		h = 0
		s = 0
	z = h ** 4 - 4 * (4 * s ** 2)
	if z < 0:
		print(-1)
	else:
		z = math.sqrt(z)
		z = h ** 2 + z
		z = z / 2
		z = math.sqrt(z)
		y = 2 * s
		try:
			y = y / z
		except ZeroDivisionError:
			y = 0
		if z > y:
			a = y
			b = z
		else:
			a = z
			b = y
		h = h * 1.0
		print(a, b, h)
	t = t - 1


from math import sqrt
t = int(input())
for qq in range(t):
	(h, s) = list(map(float, input().split()))
	h2 = h ** 2
	h4 = h ** 4
	s2 = s ** 2
	D = h4 - 16.0 * s2
	if D < 0:
		print(-1)
	else:
		D = sqrt(D)
		r1 = h2 + D
		r1 /= float(2.0)
		r2 = h2 - D
		r2 /= float(2.0)
		if r1 > 0.0:
			a = r1
		elif r2 > 0.0:
			a = r2
		else:
			print(-1)
			continue
		a = sqrt(a)
		b = 2.0 * s
		b /= a
		ans = [a, b, h]
		ans.sort()
		print('%.20f %.20f %.20f' % (ans[0], ans[1], ans[2]))


import numpy as np
ti = eval(input())
t = int(ti)
while t > 0:
	p = 0
	(hi, si) = input().split(' ')
	h = float(hi)
	s = float(si)
	r = h / 2
	alt = 2 * s / h
	if r * r - alt * alt >= 0:
		c = np.sqrt(r * r - alt * alt)
	else:
		p = 1
	e1 = r - c
	e2 = r + c
	if (p == 1) | (e2 * h >= 0):
		a = np.sqrt(e2 * h)
	else:
		p = 1
	if (p == 1) | (e1 * h >= 0):
		b = np.sqrt(e1 * h)
	else:
		p = 1
	if p == 0:
		print(b, a, h)
	else:
		print(-1)
	t -= 1


from math import sqrt
for p in range(int(input())):
	(h, s) = list(map(int, input().split()))
	x = h ** 4 - 16 * s ** 2
	if x < 0:
		print(-1)
	else:
		a = (h ** 2 + sqrt(x)) / 2
		if a < 0:
			print(-1)
		else:
			len2 = sqrt(h ** 2 - a)
			len1 = sqrt(a)
			if len1 > len2:
				print(len2, len1, h)
			else:
				print(len1, len2, h)