Chef loves triangles. But the chef is poor at maths. Given three random lengths Chef wants to find if the three sides form a right-angled triangle or not. Can you help Chef in this endeavour?

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, three Integers $A,B and C$

-----Output:-----
For each test case, output in a single line "YES" if it is possible to form a triangle using the given numbers or "NO" if it is not possible to form a triangle.

-----Constraints-----
- $1 \leq T \leq 1000000$
- $0 \leq A,B,C \leq 100$

-----Sample Input:-----
2
3 4 5
1 3 4

-----Sample Output:-----
YES
NO

-----EXPLANATION:-----
3,4,5 forms a right-angled triangle. 1, 3 and 4 does not form a right-angled triangle.

Difficulty: UNKNOWN_DIFFICULTY

Solutions:
def check(a, b, c):
	if a == 0 or b == 0 or c == 0:
		return 'NO'
	else:
		i = 3
		while i > 0:
			if a * a == b * b + c * c:
				return 'YES'
			else:
				t = a
				a = b
				b = c
				c = t
				i -= 1
	return 'NO'
try:
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		print(check(a, b, c))
except:
	print(e)
	pass


try:
	t = int(input())
	for i in range(t):
		(a, b, c) = map(int, input().split(' '))
		if a > 0 and b > 0 and (c > 0):
			if a >= b and a >= c:
				if a ** 2 == b ** 2 + c ** 2:
					print('YES')
				else:
					print('NO')
			elif b >= a and b >= c:
				if b ** 2 == a ** 2 + c ** 2:
					print('YES')
				else:
					print('NO')
			elif c ** 2 == a ** 2 + b ** 2:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
except:
	pass


for _ in range(int(input())):
	abc = sorted([int(x) for x in input().split()])
	if 0 in abc:
		print('NO')
	elif abc[-1] * abc[-1] == abc[0] * abc[0] + abc[1] * abc[1]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	num = list(map(int, input().split()))
	(A, B, C) = sorted(num)
	if A >= 1 and B >= 1 and (C >= 1):
		if A ** 2 + B ** 2 == C ** 2:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	(A, B, C) = map(int, input().split())
	if A ** 2 + B ** 2 == C ** 2:
		if A + B > C:
			print('YES')
		else:
			print('NO')
	elif B ** 2 + C ** 2 == A ** 2:
		if C + B > A:
			print('YES')
		else:
			print('NO')
	elif A ** 2 + C ** 2 == B ** 2:
		if A + C > B:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	a2 = int(pow(a, 2))
	b2 = int(pow(b, 2))
	c2 = int(pow(c, 2))
	if a == 0 or b == 0 or c == 0:
		print('NO')
		continue
	if a2 + b2 == c2:
		print('YES')
	elif c2 + b2 == a2:
		print('YES')
	elif a2 + c2 == b2:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	l = sorted(list(map(int, input().split())))
	if l[0] ** 2 + l[1] ** 2 == l[2] ** 2 and l[0] + l[1] >= l[2] and (l[0] > 0) and (l[1] > 0) and (l[2] > 0):
		print('YES')
	else:
		print('NO')


T = input()
for i in range(int(T)):
	l = list(map(int, input().split()))
	l.sort()
	if (l[2] == (l[1] ** 2 + l[0] ** 2) ** 0.5) & (l[2] != 0) & (l[0] != 0) & (l[1] != 0):
		print('YES')
	else:
		print('NO')


for test_case in range(int(input())):
	l = sorted(list(map(int, input().split())))
	x = l[0] ** 2
	y = l[1] ** 2
	z = l[2] ** 2
	if x != 0 and y != 0 and (z != 0):
		if x + y == z:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


T = int(input())
while T > 0:
	(a, b, c) = [int(x) for x in input().split()]
	if a + b > c and b + c > a and (c + a > b):
		if a ** 2 + b ** 2 == c ** 2 or b ** 2 + c ** 2 == a ** 2 or c ** 2 + a ** 2 == b ** 2:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	T -= 1


t = int(input())
while t:
	t = t - 1
	n = list(map(int, input().split()))
	n.sort()
	x = n[0] ** 2 + n[1] ** 2
	if x == n[2] ** 2 and n[0] + n[1] > n[2] and (n[0] * n[1] * n[2] != 0):
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	(a, b, c) = map(int, input().split())
	k = max(a, b, c)
	p = min(a, b, c)
	l = a + b + c - k - p
	if k ** 2 == p ** 2 + l ** 2:
		if k + p > l and k + l > p and (l + p > k) and (k - p < l) and (k - l < p) and (l - p < k):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	t = t - 1


t = int(input())
for i in range(0, t):
	x = list(map(int, input().split()))
	x.sort()
	if x[2] ** 2 == x[0] ** 2 + x[1] ** 2 and x[0] != 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	l.sort()
	if l[0] == 0:
		s = 'NO'
	else:
		for d in range(3):
			n = l[d] ** 2
			k = l[d - 1] ** 2
			j = l[d - 2] ** 2
			if n == k + j:
				s = 'YES'
				break
			else:
				s = 'NO'
	print(s)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a == 0 or b == 0 or c == 0:
		print('NO')
		continue
	if a * a + b * b == c * c:
		print('YES')
	elif a * a + c * c == b * b:
		print('YES')
	elif b * b + c * c == a * a:
		print('YES')
	else:
		print('NO')


for __ in range(int(input())):
	a = list(map(int, input().split()))
	a.sort()
	if a[0] == 0 or a[1] == 0 or a[2] == 0:
		print('NO')
	elif a[0] ** 2 + a[1] ** 2 == a[2] ** 2:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, c) = [int(x) for x in input().split()]
	if a > 0 and b > 0 and (c > 0):
		if a ** 2 + b ** 2 == c ** 2:
			print('YES')
		elif b ** 2 + c ** 2 == a ** 2:
			print('YES')
		elif a ** 2 + c ** 2 == b ** 2:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


from sys import stdin, stdout

def calc(a, b, c):
	if a ** 2 + b ** 2 == c ** 2:
		return True
	if b ** 2 + c ** 2 == a ** 2:
		return True
	if a ** 2 + c ** 2 == b ** 2:
		return True
	return False
test = int(stdin.readline())
for _ in range(test):
	(a, b, c) = map(int, stdin.readline().split())
	if a == 0 or b == 0 or c == 0:
		print('NO')
		continue
	print('YES') if calc(a, b, c) else print('NO')


tc = int(input())
for _ in range(tc):
	n = list(map(int, input().split()))
	n.sort(reverse=True)
	if n[0] <= 0 or n[1] <= 0 or n[2] <= 0:
		print('NO')
	elif n[0] * n[0] == n[1] * n[1] + n[2] * n[2]:
		print('YES')
	else:
		print('NO')


from math import sqrt
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a == 0 or b == 0 or c == 0:
		print('NO')
		continue
	x = a ** 2 + b ** 2 == c ** 2
	y = a ** 2 + c ** 2 == b ** 2
	z = b ** 2 + c ** 2 == a ** 2
	print('YES' if x or y or z else 'NO')


import sys

def main():

	def checkValidity(a, b, c):
		if a + b <= c or a + c <= b or b + c <= a:
			return False
		else:
			return True

	def checkrt(a, b, c):
		if a ** 2 + b ** 2 == c ** 2 or a ** 2 + c ** 2 == b ** 2 or b ** 2 + c ** 2 == a ** 2:
			return True
		return False
	for tc in range(int(input())):
		(a, b, c) = get_ints()
		if checkValidity(a, b, c):
			if checkrt(a, b, c):
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
get_array = lambda : list(map(int, sys.stdin.readline().split()))
get_ints = lambda : list(map(int, sys.stdin.readline().split()))
input = lambda : sys.stdin.readline().strip()
main()


t = int(input())
for _ in range(t):
	l = [int(x) for x in input().strip().split(' ')]
	l.sort()
	(a, b, c) = l
	if a > 0 and b > 0 and (c > 0) and (a * a + b * b == c * c):
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	(A, B, C) = map(int, input().split())
	ans = 'NO'
	(a_s, bs, cs) = (A * A, B * B, C * C)
	if (a_s == bs + cs or bs == a_s + cs or cs == a_s + bs) and A > 0 and (B > 0) and (C > 0):
		ans = 'YES'
	print(ans)


for _ in range(int(input())):
	int_num = list(map(int, input().split()))
	(a, b, c) = sorted(int_num)
	if a + b <= c or a + c <= b or b + c <= a or (c <= a or c <= b):
		print('NO')
	elif a ** 2 + b ** 2 == c ** 2:
		print('YES')
	else:
		print('NO')