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 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 ≤ 10^{5}$
$1 ≤ H ≤ 10^{6}$
$1 ≤ S ≤ 10^{12}$

----- Sample Input 1 ------ 
4
5 6
6 10
258303 89837245228
616153 77878145466
----- Sample Output 1 ------ 
3.00000 4.00000 5.00000
-1
-1
285168.817674 546189.769984 616153.000000

Difficulty: MEDIUM
Tags: Geometry

Mathematics

Starter code:

Solutions:
t = int(input())
import math
for _ in range(t):
	(h, s) = map(float, input().split())
	a1 = h ** 2 + 4 * s
	a2 = h ** 2 - 4 * s
	if a2 < 0:
		print(-1)
		continue
	s1 = math.sqrt(h ** 2 + 4 * s)
	s2 = math.sqrt(h ** 2 - 4 * s)
	a = (s1 + s2) / 2
	b = (s1 - s2) / 2
	print(*sorted((a, b, h)))


test = int(input())
for _ in range(test):
	(h, s) = map(float, input().split())
	if h ** 4 < 16 * s ** 2:
		print('-1')
	else:
		a = round(((h ** 2 + (h ** 4 - 16 * s * s) ** 0.5) / 2) ** 0.5, 6)
		b = round(((h ** 2 - (h ** 4 - 16 * s * s) ** 0.5) / 2) ** 0.5, 6)
		print(b, a, h)


import math
T = int(input())
for i in range(T):
	(h, S) = map(float, input().split())
	c1 = float(S * 2 / h)
	a = 1
	b = -1 * (h * h)
	c = S * 2 * (S * 2)
	d = b * b - 4 * a * c
	if d < 0:
		print(-1)
	else:
		d = math.sqrt(d)
		sol1 = (-b + d) / (2 * a)
		sol2 = (-b - d) / (2 * a)
		print('%.6f' % math.sqrt(sol2), '%.6f' % math.sqrt(sol1), '%.6f' % h)


from math import sqrt
T = int(input())
for t in range(T):
	(H, S) = map(int, input().split())
	p1 = H ** 2
	p2 = 4 * S
	try:
		F1 = sqrt(p1 + p2)
		F2 = sqrt(p1 - p2)
		a = (F1 + F2) / 2
		b = (F1 - F2) / 2
		print(b, a, H)
	except:
		print(-1)


import math

def solve():
	(h, s) = map(int, input().split())
	if h ** 2 < 4 * s:
		return None
	d = math.sqrt(h ** 4 - 16 * s ** 2)
	return [math.sqrt((h ** 2 - d) / 2), math.sqrt((h ** 2 + d) / 2), h]
t = int(input())
for _ in range(t):
	ans = solve()
	if ans == None:
		print(-1)
	else:
		print(*ans)


t = int(input())
for i in range(t):
	(H, S) = map(float, input().split())
	ans = pow(H, 4) - 16 * pow(S, 2)
	if ans < 0:
		print(-1)
	else:
		h = pow((H * H + pow(ans, 0.5)) / 2, 0.5)
		b = 2 * S / h
		if b > h:
			print(h, b, H)
		else:
			print(b, h, H)


import math
for _ in range(int(input())):
	(h, s) = map(int, input().split())
	if h ** 2 - 4 * s >= 0:
		x = math.sqrt(h ** 2 + 4 * s)
		y = math.sqrt(h ** 2 - 4 * s)
		a = (x + y) / 2
		b = (x - y) / 2
		print(b, a, h)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(d, m) = map(int, input().split())
	m *= 2
	if 2 * m > d * d:
		print(-1)
	else:
		a = pow(d * d + 2 * m, 0.5)
		b = pow(d * d - 2 * m, 0.5)
		x = (a + b) / 2
		y = (a - b) / 2
		l = [x, y, d]
		l.sort()
		print(*l)


import math as m
for i in range(int(input())):
	(h, s) = map(int, input().split())
	h2 = h ** 2
	s = s * 4
	if h2 - s < 0:
		print(-1)
		continue
	summ = m.sqrt(h2 + s)
	diff = m.sqrt(h2 - s)
	x = (summ + diff) / 2
	y = summ - x
	print(min(x, y), max(x, y), float(h))


import math
t = int(input())
while t > 0:
	t -= 1
	ip = input().split()
	(h, s) = [int(i) for i in ip]
	s4 = 4 * s
	h2 = h ** 2
	amb = h2 - s4
	if amb < 0:
		print('-1')
		continue
	apb = math.sqrt(h2 + s4)
	amb = math.sqrt(amb)
	x = (apb + amb) / 2
	y = apb - x
	print(min(x, y), max(x, y), float(h))


import math

def rightT(h, s):
	if h * h - 4 * s < 0:
		print('-1')
		return
	t = math.sqrt(h * h + 4 * s)
	k = math.sqrt(h * h - 4 * s)
	print((t - k) / 2, end=' ')
	print((t + k) / 2, end=' ')
	print(h)
	return
for _ in range(int(input())):
	(h, s) = map(int, input().split())
	rightT(h, s)


out = []
for _ in range(int(input())):
	(h, s) = map(int, input().split())
	ans = [h]
	(be, en) = (0, (pow(h, 2) / 2) ** 0.5)
	while en - be > 10 ** (-9):
		md = (be + en) / 2
		md2 = (h ** 2 - md ** 2) ** 0.5
		if md * md2 <= 2 * s:
			be = md
		else:
			en = md
	(md, md2) = (be, (h ** 2 - be ** 2) ** 0.5)
	if 4 * s - h * h > 0.01:
		out.append('-1')
	else:
		ans.append(md)
		ans.append(md2)
		ans.sort()
		out.append(f'{ans[0]} {ans[1]} {ans[2]}')
print('\n'.join(out))


import math
t = int(input())
while t:
	c = []
	a = input()
	a = [int(i) for i in a.split()]
	d = a[0] * a[0] - 4 * a[1]
	e = a[0] * a[0] + 4 * a[1]
	if d >= 0:
		p = (math.sqrt(e) + math.sqrt(d)) / 2
		b = (math.sqrt(e) - math.sqrt(d)) / 2
		c.append(p)
		c.append(b)
		c.append(float(a[0]))
		c.sort()
		for i in range(len(c)):
			print(c[i], end=' ')
		print()
	else:
		print('-1')
	t = t - 1


T = int(input())
for _ in range(T):
	(D, S) = (int(_) for _ in input().split())
	max_b = (D ** 2 / 2) ** 0.5
	S *= 2
	if D ** 2 < 2 * S:
		print(-1)
	else:
		left = 0
		right = max_b
		(a, b) = (0, 0)
		while right - left > 10 ** (-9):
			a = (left + right) / 2
			b = (D ** 2 - a ** 2) ** 0.5
			if a * b >= S:
				right = a
			else:
				left = a
		print(a, b, D)


from math import sqrt
for _ in range(int(input())):
	(h, s) = map(int, input().split())
	d = h ** 4 - 16 * s ** 2
	if d < 0:
		print(-1)
	else:
		(a, b) = (sqrt((h ** 2 + sqrt(d)) / 2), sqrt((h ** 2 - sqrt(d)) / 2))
		print(min(a, b), max(a, b), float(h))


from decimal import *
from math import *
from tokenize import Double
for _ in range(int(input())):
	(h, s) = map(float, input().split())
	if h * h - 4 * s < 0:
		print(-1)
		continue
	a = (sqrt(h * h + 4 * s) + sqrt(h * h - 4 * s)) / 2
	b = (sqrt(h * h + 4 * s) - sqrt(h * h - 4 * s)) / 2
	l = [0.0] * 3
	l[0] = a
	l[1] = b
	l[2] = h
	l.sort()
	if l[0] == 0 or l[1] == 0 or l[2] == 0:
		print(-1)
		continue
	if l[2] >= l[0] + l[1]:
		print(-1)
		continue
	print(*l)


import math

def find(h, s):
	p = float(math.sqrt(h * h * h * h - 16 * (s * s)))
	l = float(math.sqrt((h * h - p) / 2))
	b = float(math.sqrt((h * h + p) / 2))
	print('{0} {1} {2}'.format(l, b, h))
t = int(input())
while t:
	(h, s) = [float(x) for x in input().split()]
	if h * h < 4 * s:
		print(-1)
	else:
		find(h, s)
	t = t - 1


import sys
sys.setrecursionlimit(1000000)
t = int(input())
test_cases = [tuple(map(int, input().split())) for _ in range(t)]
for test_case in test_cases:
	(h, s) = test_case
	if 16 * s ** 2 > h ** 4:
		print(-1)
		continue
	b = ((h ** 2 + (h ** 4 - 16 * s ** 2) ** (1 / 2)) / 2) ** (1 / 2)
	p = (h ** 2 - b ** 2) ** (1 / 2)
	print(min(b, p), max(b, p), h)


import math
for oo in range(int(input())):
	(h, s) = map(int, input().split())
	b = h * h * h * h - 16 * s * s
	if b < 0:
		print(-1)
	else:
		x = (h * h - math.sqrt(b)) / 2
		c = math.sqrt(x)
		d = math.sqrt(h * h - x)
		if c < d:
			print('%.6f' % c, '%.6f' % d, '%.6f' % h)
		else:
			print('%.6f' % d, '%.6f' % c, '%.6f' % h)


import math
for i in range(int(input())):
	(h, s) = map(int, input().split())
	q = []
	if h ** 2 < 4 * s:
		print(-1)
	else:
		p = ((h ** 2 + (h ** 4 - 16 * s ** 2) ** (1 / 2)) / 2) ** (1 / 2)
		b = 2 * s / p
		qw = [p, b, h]
		qw.sort()
		print(*qw)


import math as m
t = int(input())
for i in range(t):
	f = []
	(H, S) = input().split()
	H = int(H)
	S = int(S)
	if H * H - 4 * S < 0:
		print(-1)
	else:
		k = []
		l = m.sqrt(H ** 4 - 16 * S * S)
		a = m.sqrt((H ** 2 - l) / 2)
		b = m.sqrt((H ** 2 + l) / 2)
		f.append(float(H))
		f.append(a)
		f.append(b)
		k = sorted(f)
		for i in k:
			print(i, end=' ')
		print()


import math
for i in range(int(input())):
	(h, s) = map(int, input().split())
	p = s * 2
	if h ** 2 - 2 * p < 0:
		print(-1)
		continue
	B = ((h ** 2 + 2 * p) ** 0.5 + (h ** 2 - 2 * p) ** 0.5) / 2
	H = p / B
	print('%.6f %.6f %.6f' % (min(B, H), max(B, H), h))


from collections import *
import math
for test in range(int(input())):
	(h, s) = map(float, input().split(' '))
	d = h ** 4 - 16 * s ** 2
	if h * h < 4 * s or h == 0:
		print(-1)
		continue
	else:
		x = ((h * h + (h * h * h * h - 16 * s * s) ** 0.5) / 2.0) ** 0.5
		y = 2.0 * s / x
		if y > x:
			print('%.6f %.6f %.6f' % (x, y, h))
		else:
			print('%.6f %.6f %.6f' % (y, x, h))


for i in range(int(input())):
	(h, s) = list(map(int, input().split()))
	if h ** 4 - 16 * s * s < 0:
		print(-1)
		continue
	l = [((h * h - (h ** 4 - 16 * s * s) ** (1 / 2)) / 2) ** (1 / 2), ((h * h + (h ** 4 - 16 * s * s) ** (1 / 2)) / 2) ** (1 / 2), h]
	l = sorted(l)
	print(l[0], l[1], l[2])


import sys
import math
import bisect

def solve(h, s):
	a2_b2 = h ** 2
	ab = 2 * s
	if a2_b2 + 2 * ab < 0 or a2_b2 - 2 * ab < 0:
		return None
	x = math.sqrt(a2_b2 + 2 * ab)
	y = math.sqrt(a2_b2 - 2 * ab)
	a = (x + y) / 2
	b = (x - y) / 2
	c = math.sqrt(a ** 2 + b ** 2)
	return sorted([a, b, c])

def main():
	for _ in range(int(input())):
		(h, s) = map(int, input().split())
		ans = solve(h, s)
		if ans:
			print('%.10f %.10f %.10f' % (ans[0], ans[1], ans[2]))
		else:
			print(-1)
main()


import math
t = int(input())
for i in range(t):
	(h, s) = map(int, input().split())
	s2 = 4 * s
	h2 = h ** 2
	c = h2 - s2
	if c < 0:
		print('-1')
		continue
	c2 = math.sqrt(h2 + s2)
	c = math.sqrt(c)
	x = (c2 + c) / 2
	y = c2 - x
	print(min(x, y), max(x, y), float(h))


T = int(input())
while T:
	(H, A) = map(int, input().rstrip().rsplit())
	if H ** 2 - 4 * A < 0:
		print(-1)
	else:
		(a, b, c) = (1, (H ** 2 - 4 * A) ** 0.5, -2 * A)
		P = (-b + (b ** 2 - 4 * a * c) ** 0.5) / (2 * a)
		B = P + b
		print(str(P) + ' ' + str(B) + ' ' + str(H))
	T -= 1


from math import sqrt
for _ in range(int(input())):
	(H, S) = map(int, input().split())
	if H * H - 4 * S < 0:
		print(-1)
	else:
		sum = sqrt(H * H + 4 * S)
		diff = sqrt(H * H - 4 * S)
		print((sum - diff) / 2, (sum + diff) / 2, H)


import math
for __ in range(int(input())):
	(H, S) = map(int, input().split())
	D = H ** 4 - 16 * S ** 2
	if D >= 0:
		a = math.sqrt((H ** 2 + math.sqrt(D)) / 2)
		b = math.sqrt((H ** 2 - math.sqrt(D)) / 2)
		if a > b:
			(a, b) = (b, a)
		print(a, b, H)
	else:
		print(-1)


import sys
import math

def main(h, s):
	check = h ** 4 - 16 * s ** 2
	ans = [None, None, h]
	if check >= 0:
		temp = (h ** 2 + math.sqrt(check)) / 2
		if temp > 0:
			a = math.sqrt(temp)
			b = math.sqrt(h ** 2 - a ** 2)
			ans[0] = a
			ans[1] = b
			ans.sort()
			print(*ans)
			return
	print(-1)
	return
t = int(input())
for i in range(t):
	(h, s) = list(map(int, input().split()))
	main(h, s)


test = int(input())
for z in range(test):
	(H, S) = map(int, input().split())
	d = H ** 4 - 4 * (2 * S) ** 2
	if d < 0:
		print(-1)
	else:
		P = ((H ** 2 + d ** 0.5) / 2) ** 0.5
		B = 2 * S / P
		a = [H * 1.0, P, B]
		a.sort()
		print(*a)


import sys
input = sys.stdin.readline

def rii():
	return range(int(input().strip()))

def ii():
	return int(input().strip())

def mii():
	return map(int, input().strip().split(' '))

def lmii():
	return list(map(int, input().strip().split(' ')))

def si():
	return str(input().strip())
from math import sqrt
decimal_places = 6
failure = '-1'

def fn(h, s):
	return pow(h, 4) - 16 * pow(s, 2)

def get_ab(h, s):
	b2 = (h ** 2 + sqrt(fn(h, s))) / 2
	a2 = h ** 2 - b2
	if a2 > b2:
		(a2, b2) = (b2, a2)
	return ' '.join([*map(lambda x: f'{x:.{decimal_places}f}', (sqrt(a2), sqrt(b2), h))])

def solve(*args):
	(h, s) = args
	if fn(h, s) >= 0:
		return get_ab(h, s)
	else:
		return failure

def do_codechef():
	for t in rii():
		(h, s) = mii()
		print(solve(h, s))
do_codechef()
exit()


Q = int(input())
while Q > 0:
	Q -= 1
	(h, s) = [int(x) for x in input().split()]
	d = h ** 4 - 16 * s * s
	if d < 0:
		print(-1)
	else:
		d = d ** 0.5
		b = (h * h + d) / 2
		b = b ** 0.5
		if b == 0:
			print(-1)
			continue
		a = 2 * s / b
		if a > b:
			(a, b) = (b, a)
		print('%.6f %.6f %.6f' % (a, b, h))


t = int(input())
import math
for _ in range(t):
	(h, s) = map(float, input().split())
	k1 = h ** 2 + 4 * s
	k2 = h ** 2 - 4 * s
	if k2 < 0:
		print(-1)
		continue
	s1 = math.sqrt(h ** 2 + 4 * s)
	s2 = math.sqrt(h ** 2 - 4 * s)
	b = (s1 + s2) / 2
	p = (s1 - s2) / 2
	print(*sorted((p, b, h)))


import math
for i in range(int(input())):
	(h, s) = map(int, input().split())
	delta = math.pow(h, 4) - 16 * math.pow(s, 2)
	if delta < 0:
		print(-1)
	elif delta == 0:
		ans = h / math.sqrt(2)
		print(ans, ans, h)
	else:
		ans = math.sqrt(delta)
		k = math.pow(h, 2)
		ans_1 = round(math.sqrt((k + ans) / 2), 6)
		ans_2 = round(math.sqrt((k - ans) / 2), 6)
		print(ans_2, ans_1, h)


import math
t = int(input())
for _ in range(t):
	(h, s) = map(int, input().split())
	flag = 1
	l = 0
	b = 0
	if h * h - 4 * s < 0:
		print('-1')
	else:
		x = math.sqrt(h * h + 4 * s)
		y = math.sqrt(h * h - 4 * s)
		l = (x + y) / 2
		b = (x - y) / 2
		temp = [l, b, h]
		temp.sort()
		ans = ''
		for i in temp:
			ans += str(i) + ' '
		ans = ans.strip()
		print(ans)


import math
t = int(input())
for i in range(t):
	(h, s) = input().split()
	h = float(h)
	s = float(s)
	a = 1
	b = -1 * (h * h)
	c = s * 2 * (s * 2)
	d = b * b - 4 * a * c
	if d < 0:
		print(-1)
	else:
		d = math.sqrt(d)
		sol1 = (-b + d) / (2 * a)
		sol2 = (-b - d) / (2 * a)
		print('%.6f' % math.sqrt(sol2), '%.6f' % math.sqrt(sol1), '%.6f' % h)


from collections import defaultdict as dd
from collections import Counter as ccd
from itertools import permutations as pp
from itertools import combinations as cc
from random import randint as rd
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq as hq
import math
mod = pow(10, 9) + 7

def inp(flag=0):
	if flag == 0:
		return list(map(int, input().strip().split(' ')))
	else:
		return int(input())
t = inp(1)
while t:
	t -= 1
	(h, s) = inp()
	if h ** 2 < 4 * s:
		print(-1)
	else:
		n1 = math.sqrt(h ** 2 + 4 * s)
		n2 = math.sqrt(h ** 2 - 4 * s)
		b = 0.5 * (n1 + n2)
		a = n1 - b
		print(*sorted([a, b, h]))


for _ in range(int(input())):
	(h, s) = map(int, input().split())
	t = h ** 4 - 16 * s ** 2
	if t < 0:
		print(-1)
	else:
		b = ((h ** 2 + t ** 0.5) / 2) ** 0.5
		p = (h ** 2 - b ** 2) ** 0.5
		l = max(b, p)
		l1 = min(b, p)
		print(l1, l, h)


import math
for i in range(int(input())):
	l = list(map(int, input().split()))
	h = l[0]
	s = l[1]
	r = h ** 4 - 16 * (s * s)
	u = []
	if r < 0:
		print(-1)
	else:
		q = math.sqrt((h ** 2 + math.sqrt(r)) / 2)
		y = math.sqrt(h ** 2 - q ** 2)
		u.append(float(q))
		u.append(float(y))
		u.append(float(h))
	u = sorted(u)
	print(*u)


import math
for i in range(int(input())):
	(h, s) = map(int, input().split())
	D = h ** 4 - 16 * s ** 2
	if D >= 0:
		a = math.sqrt((h ** 2 + math.sqrt(D)) / 2)
		b = math.sqrt((h ** 2 - math.sqrt(D)) / 2)
		if a > b:
			(a, b) = (b, a)
		print(a, b, h)
	else:
		print(-1)


import math
t = int(input())
while t > 0:
	(h, s) = map(int, input().split())
	ans = []
	ans.append(float(h))
	temp = h ** 4 - 16 * s ** 2
	if temp >= 0:
		ans.append(math.sqrt((h ** 2 + math.sqrt(temp)) / 2))
		ans.append(math.sqrt((h ** 2 - math.sqrt(temp)) / 2))
		ans.sort()
		for i in range(3):
			print(ans[i], end=' ')
		print()
	else:
		print(-1)
	t -= 1


import math
for _ in range(int(input())):
	(h, s) = map(int, input().split())
	s1 = math.sqrt(h * h + 4 * s)
	try:
		s2 = math.sqrt(h * h - 4 * s)
		l = [round((s1 + s2) / 2, 6), round((s1 - s2) / 2, 6), float(h)]
		print(*sorted(l))
	except:
		print(-1)


T = int(input())

def RightTriangle(H, S):
	if H ** 2 - 4 * S < 0:
		return -1
	a = (H ** 2 + 4 * S) ** 0.5
	b = (H ** 2 - 4 * S) ** 0.5
	c = (a + b) / 2
	d = (a - b) / 2
	if c <= 0 and d <= 0:
		return -1
	else:
		e = str(d) + ' ' + str(c) + ' ' + str(H)
		return e
for i in range(T):
	(H, S) = map(int, input().split())
	print(RightTriangle(H, S))


import math
__ = int(input())
for ___ in range(0, __):
	(h, s) = map(int, input().split())
	t = h ** 4 - 16 * s * s
	if t < 0:
		print(-1)
	else:
		t_sq = t ** 0.5
		a1 = ((h * h + t_sq) / 2) ** 0.5
		b1 = 2 * s / a1
		print(*sorted([a1, b1, h]))


for _ in range(int(input())):
	(h, s) = input().split()
	h = float(h)
	s = float(s)
	if h * h - 4 * s < 0:
		print(-1)
		continue
	apb = (h * h + 4 * s) ** 0.5
	amb = (h * h - 4 * s) ** 0.5
	a = (apb + amb) / 2
	b = (apb - amb) / 2
	print(min(a, b), max(a, b), h)


def power(x, y):
	res = 1
	while y > 0:
		if y & 1 == 1:
			res = res * x
		y = y >> 1
		x = x * x
	return res
import math
t = int(input())
for i in range(t):
	c = []
	(h, s) = map(int, input().split())
	x = power(h, 4) - 16 * power(s, 2)
	if x < 0:
		print(-1)
	else:
		b = math.sqrt((power(h, 2) - math.sqrt(x)) / 2)
		a = math.sqrt((power(h, 2) + math.sqrt(x)) / 2)
		c.append(h)
		c.append(a)
		c.append(b)
		c.sort()
		for j in c:
			print('%.6f' % j, end=' ')
		print('')


t = int(input())
import math
while t > 0:
	(h, s) = map(int, input().split())
	q = 4 * s
	if h ** 2 - q >= 0:
		a = math.sqrt(h ** 2 + q)
		b = math.sqrt(h ** 2 - q)
		x = (a + b) / 2
		y = (a - b) / 2
		if x > y:
			print(y, x, h)
		else:
			print(x, y, h)
	else:
		print(-1)
	t -= 1


for oo in range(int(input())):
	(h, s) = map(int, input().split())
	b = h * h * h * h - 16 * s * s
	if b < 0:
		print(-1)
	else:
		x = (h * h - b ** 0.5) / 2
		c = x ** 0.5
		d = (h * h - x) ** 0.5
		if c < d:
			print('%.6f' % c, '%.6f' % d, '%.6f' % h)
		else:
			print('%.6f' % d, '%.6f' % c, '%.6f' % h)


for _ in range(int(input())):
	(h, area) = map(int, input().split())
	k = (h ** 2 + 4 * area) ** 0.5
	l = (h ** 2 - 4 * area) ** 0.5
	if h ** 2 - 4 * area < 0:
		print(-1)
	else:
		a = (k - l) / 2
		b = (k + l) / 2
		h = (a ** 2 + b ** 2) ** 0.5
		print(round(a, 6), round(b, 6), round(h, 6))


a = int(input())
for i in range(a):
	b = list(map(int, str(input()).split(' ')))
	li = []
	if b[0] ** 2 < 4 * b[1]:
		print(-1)
	else:
		li.append((b[0] ** 2 + 4 * b[1]) ** 0.5)
		li.append((b[0] ** 2 - 4 * b[1]) ** 0.5)
		li.append((li[0] + li[1]) / 2)
		li.append((li[0] - li[1]) / 2)
		print(min(li[2], li[3]), max(li[2], li[3]), b[0])


from math import *
t = int(input())
for i in range(0, t):
	(h, s) = map(int, input().split())
	d = pow(h, 4) - 16 * pow(s, 2)
	if d < 0:
		print('-1')
	elif d >= 0:
		a = (pow(h, 2) + sqrt(d)) / 2
		a = sqrt(a)
		b = 2 * s / a
		lst = [a, b, h]
		lst.sort()
		print(*lst)


from math import *
for j in range(int(input())):
	(h, s) = map(int, input().split())
	d = h ** 4 - 16 * s * s
	if d >= 0:
		a = sqrt((h * h + sqrt(d)) / 2)
		b = sqrt((h * h - sqrt(d)) / 2)
		if a > b:
			(a, b) = (b, a)
		print(a, b, h)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	s = input().split(' ')
	(h, s) = (int(s[0]), int(s[1]))
	if h ** 4 < 16 * s * s:
		print(-1)
	else:
		d = (h ** 4 - 16 * s * s) ** 0.5
		m = h * h + d
		m = m / 2
		a = m ** 0.5
		b = 2 * s / a
		print(*sorted([a, b, h]))


for _ in range(int(input())):
	(h, s) = map(int, input().split())
	a = h ** 4 - 16 * s ** 2
	if a < 0:
		print(-1)
	else:
		print(((h ** 2 - a ** 0.5) / 2) ** 0.5, ((h ** 2 + a ** 0.5) / 2) ** 0.5, h)


import sys
import math
import heapq
import bisect
import string
import functools
import itertools
import collections
t = int(sys.stdin.readline().strip(' ').strip('\n'))
for _ in range(t):
	(h, s) = list(map(int, sys.stdin.readline().strip(' ').strip('\n').split()))
	try:
		temp = math.sqrt(pow(h, 4) - 4 * 4 * pow(s, 2))
		a = math.sqrt((pow(h, 2) + temp) / 2.0)
		b = 2 * s / a
		l = [a, b, float(h)]
		l.sort()
		sys.stdout.write(str(l[0]) + ' ' + str(l[1]) + ' ' + str(l[2]) + '\n')
	except:
		sys.stdout.write('-1\n')


from math import *

def test(h, a):
	if h * h >= 4 * a:
		x = (h * h + 4 * a) ** (1 / 2)
		y = (h * h - 4 * a) ** (1 / 2)
		l = (x - y) / 2
		b = (x + y) / 2
		if float(trunc(x)) == x:
			print('{0:.5f}'.format(l), '{0:.5f}'.format(b), '{0:.5f}'.format(h))
		elif type(x) == float:
			print('{0:.6f}'.format(l), '{0:.6f}'.format(b), '{0:.6f}'.format(h))
	else:
		print('-1')
t = int(input())
while t > 0:
	(h, a) = map(int, input().split(' '))
	test(h, a)
	t -= 1


for _ in range(int(input())):
	(H, S) = map(float, input().split())
	if H ** 4 < 16 * S ** 2:
		print('-1')
	else:
		a = round(((H ** 2 + (H ** 4 - 16 * S * S) ** 0.5) / 2) ** 0.5, 6)
		b = round(((H ** 2 - (H ** 4 - 16 * S * S) ** 0.5) / 2) ** 0.5, 6)
		print(b, a, H)