Problem:
Is it a Right Triangle? Write a program which judges wheather given length of three side form a right triangle. Print " YES " if the given sides (integers) form a right triangle, " NO " if not so. Input Input consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space. Constraints  1 ≤ length of the side ≤ 1,000   N ≤ 1,000  Output For each data set, print " YES " or " NO ". Sample Input 3
4 3 5
4 3 6
8 8 8 Output for the Sample Input YES
NO
NO

Solution (Python):
for i in range(int(input())):
    a,b,c=map(lambda x:int(x)**2,input().split())
    if a+b==c or b+c==a or c+a==b:
        print("YES")
    else:
        print("NO")

Solution (Python):
n = int(raw_input())
for i in range(n):
    num = map(int, raw_input().split())
    num.sort(reverse=True)
    if num[0]**2 == num[1]**2 + num[2]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
import math

N = int(input())

for i in range(N):
  side_len = list(map(int, input().split(" ")))
  side_len.sort()
  if int(math.pow(side_len[0], 2)) + int(math.pow(side_len[1], 2)) == int(math.pow(side_len[2], 2)):
    print("YES")
  else:
    print("NO")

Solution (Python):
n=int(input())
for _ in range(n):
    a,b,c=sorted([int(i) for i in input().split()])
    print("YES" if c**2==a**2+b**2 else "NO")

Solution (Python):
N = int(input())

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

Solution (Python):
N = int(input())

for i in range(N):
    adjacent_side_1, adjacent_side_2, hypotenuse = sorted(list(map(int, input().split())))
    if adjacent_side_1**2 + adjacent_side_2**2 == hypotenuse**2:
        print('YES')
    else:
        print('NO')

Solution (Python):
n = input()
for i in range(int(n)):
    a,b,c = list(map(int,input().split()))
    a,b,c = int(a),int(b),int(c)
    if a**2 + b**2 == c**2 or c**2 + a**2 == b**2 or b**2 + c**2 == a**2:
        print("YES")
    else:
        print("NO")

Solution (Python):
n = int(input())
for _ in range(n):
    a,b,c = list(map(int,input().split()))
    if a**2 + b**2 == c**2 or c**2 + b**2 == a**2 or a**2 + c**2 == b**2 :
        print("YES")
    else :
        print("NO")

Solution (Python):
n=int(input())
for i in range(n):
    p=list(map(int,input().split()))
    p.sort()
    a=p[0]
    b=p[1]
    c=p[2]
    if a*a+b*b==c*c:
        print('YES')
    else:
        print('NO')

Solution (Python):
n=int(input())
for i in range(n):
    p=list(map(int,input().split(" ")))
    p.sort()
    a=p[0]
    b=p[1]
    c=p[2]
    if pow(a,2) + pow(b,2) == pow(c,2):
        print('YES')
    else:
        print('NO')

Solution (Python):
n=int(input())
for i in range(n):
    p=list(map(int,input().split(" ")))
    p.sort()
    if pow(p[0],2) + pow(p[1],2) == pow(p[2],2):
        print('YES')
    else:
        print('NO')

Solution (Python):
n=int(input())
for i in range(n):
    p=list(map(int,input().split(" ")))
    p.sort()
    if pow(p[0],2) + pow(p[1],2) == pow(p[2],2):
        print('YES')
    else:
        print('NO')

Solution (Python):
n=int(input())
for i in range(n):
    a,b,c = input().split()
    x = int(a)
    y = int(b)
    z = int(c)
    p = [x,y,z]
    p.sort()
    if pow(p[0],2) + pow(p[1],2) == pow(p[2],2):
        print('YES')
    else:
        print('NO')

Solution (Python):
n=int(input())
for i in range(n):
    a,b,c = input().split()
    x = int(a)
    y = int(b)
    z = int(c)
    p = [x,y,z]
    p.sort()
    if pow(p[0],2) + pow(p[1],2) == pow(p[2],2):
        print('YES')
    else:
        print('NO')

Solution (Python):
n=int(input())
for i in range(n):
    p=list(map(int,input().split(" ")))
    p.sort()
    if pow(p[0],2) + pow(p[1],2) == pow(p[2],2):
        print('YES')
    else:
        print('NO')

Solution (Python):
n =  int(input())
for i in range(n):
    tri_list = list(map(int,input().split(" ")))
    
    tri_list.sort()
    a = int(tri_list[2]) ** 2
    b = int(tri_list[0]) ** 2 + int(tri_list[1]) ** 2
    if a == b:
        print("YES")
    else:
        print("NO")

Solution (Python):
n=int(input())
for i in range(n):
    a,b,c = input().split()
    x = int(a)
    y = int(b)
    z = int(c)
    p = [x,y,z]
    p.sort()
    if pow(p[0],2) + pow(p[1],2) == pow(p[2],2):
        print('YES')
    else:
        print('NO')

Solution (Python):
n =  int(input())
for i in range(n):
    tri_list = list(map(int,input().split(" ")))
    tri_list.sort()
    a = int(tri_list[2]) ** 2
    b = int(tri_list[0]) ** 2 + int(tri_list[1]) ** 2
    if a == b:
        print("YES")
    else:
        print("NO")

Solution (Python):
n =  int(input())
for i in range(n):
    tri_list = list(map(int,input().split(" ")))
    tri_list.sort()
    a = int(tri_list[2]) ** 2
    b = int(tri_list[0]) ** 2 + int(tri_list[1]) ** 2
    if a == b:
        print("YES")
    else:
        print("NO")

Solution (Python):

for i in range(int(input())):
    values = sorted(map(lambda x: int(x)**2, input().split(' ')))
    if values[2] == values[1] + values[0]:
        print("YES")
    else:
        print("NO")

Solution (Python):

for i in range(int(input())):
    values = sorted(map(lambda x: int(x)**2, input().split(' ')))
    if values[2] == values[1] + values[0]:
        print("YES")
    else:
        print("NO")

Solution (Python):
N = int(input())

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

Solution (Python):
n = int(input())
for i in range(n):
    x, y, z =map(int, input().split())
    if x*x + y*y == z*z or y*y + z*z == x*x or x*x + z*z == y*y :
        print("YES")
    else:
        print("NO")

Solution (Python):
n = int(input())
for i in range(0, n):
    a, b, c = sorted(map(int, input().split()))
    print("YES" if c*c == a*a+b*b else "NO")

Solution (Python):
n = int(raw_input())
for _ in xrange(n):
  ls = sorted(map(int, raw_input().split()))
  if ls[2]**2 == ls[0]**2+ls[1]**2: print "YES"
  else: print "NO"

Solution (Python):
n = int(input())
for i in range(0, n):
    a, b, c = sorted(map(int, input().strip("\n").split(" ")))
    
    
    if c*c - (a*a + b*b) == 0:
        print("YES")
    else:
        print("NO")

Solution (Python):
n = input()
for i in range(n):
    l = map(int, raw_input().split())
    l.sort()
    if(l[0] * l[0] + l[1] * l[1] == l[2] * l[2]):
        print("YES")
    else:
        print("NO")

Solution (Python):
rep = input()
while rep:
	rep -= 1
	[a, b, c] = map(int, raw_input().split())
	if b < a and c < a:
		a **= 2
		b = b ** 2 + c ** 2
	elif a < b and c < b:
		a = a ** 2 + c ** 2	
		b **= 2
	else:
		a = a ** 2 + b ** 2
		b = c ** 2
	if a == b:
		print 'YES'
	else:
		print 'NO'

Solution (Python):
n = raw_input()
while 1:
	try :
		a = map(int,raw_input().split())
		a.sort()
		a.reverse()

		if a[0]**2 == a[1]**2 + a[2]**2:
			print "YES"
		else : 
			print "NO"
	except EOFError:
		break

Solution (Python):
import itertools
def check(a,b,c):
    for p in itertools.permutations([a,b,c]):
        (x,y,z)=p
        if x*x+y*y==z*z:
            return True
    return False

n=input()
for i in range(n):
    (a,b,c)=map(eval,raw_input().split())
    if check(a,b,c):
        print "YES"
    else:
        print "NO"

Solution (Python):
n = int(raw_input())
for i in range(n):
    edge = map(int,raw_input().split(" "))
    e0 = edge[0] * edge[0]
    e1 = edge[1] * edge[1]
    e2 = edge[2] * edge[2]
    ret = "NO"
    if (edge[0] > edge[1]) and (edge[0] > edge[2]):
        if (e0 - e1 - e2) == 0:
            ret = "YES"
    if (edge[1] > edge[0]) and (edge[1] > edge[2]):
        if (e1 - e0 - e2) == 0:
            ret = "YES"
    if (edge[2] > edge[0]) and (edge[2] > edge[1]):
        if (e2 - e0 - e1) == 0:
            ret = "YES"
    print ret

Solution (Python):
n=int(input())
for i in range(n):
  edge=input().split()
  edge=[int(j) for j in edge]
  edge.sort()
  if(edge[0]**2+edge[1]**2==edge[2]**2):
    print("YES")
  else:
    print("NO")

Solution (Python):
import sys

N = int(raw_input())
for line in sys.stdin:
    a, b, c = sorted(map(int, line.split()))
    if a ** 2 + b ** 2 == c ** 2:
        print 'YES'
    else:
        print 'NO'

Solution (Python):



import sys


data_list = []
for s in sys.stdin:
  data_list.append( map(int,s.split()) )

for e in data_list[1:]:
  e.sort()
  if e[0]*e[0] + e[1]*e[1] == e[2] * e[2]:
    print "YES"
  else:
    print "NO"

Solution (Python):
import math
import itertools

for i in range(int(input())):
    a, b, c = sorted(map(int, input().split()))
    print('YES' if a*a+b*b==c*c else 'NO')

Solution (Python):
n = input()

for i in range(n):
    s = map(int, raw_input().split())
    s.sort()
    if s[2]**2 == (s[0]**2) + (s[1]**2): print "YES"
    else: print "NO"

Solution (Python):
import sys

data_list = sys.stdin.readlines()
data_length = int(data_list.pop(0))

for x in xrange(data_length):
	lines = map(int, data_list[x].strip().split())
	lines.sort(reverse = True)
	if lines[0]**2 == (lines[1]**2 + lines[2]**2):
		print "YES"
	else:
		print "NO"

Solution (Python):


N = int(input())

for i in range(N):
    a,b,c = map(int, input().split())
    flg = 0
    if a*a + b*b == c*c:
        flg = 1
    if c*c + a*a == b*b:
        flg = 1
    if b*b + c*c == a*a:
        flg = 1
    if flg == 1:
        print('YES')
    else:
        print('NO')

Solution (Python):
for _ in range(int(input())):
	a=list(map(int,input().split()))
	a.sort()
	print("YES") if a[0]**2+a[1]**2==a[2]**2 else print("NO")

Solution (Python):
def pascal(xdata):
	for x in xrange(3):
		for y in xrange(3):
			for z in xrange(3):
				if xdata[x]**2 + xdata[y]**2 == xdata[z]**2:
					return True
	return False

N = input()
data = [map(int, raw_input().split()) for x in range(N)]

for x in data:
	if pascal(x):
		print "YES"
	else:
		print "NO"

Solution (Python):

import sys
n = int(raw_input())
        
while True:
    try :
        a = sorted(map(int,raw_input().split()))
        print "YES" if a[0] ** 2 + a[1] ** 2 == a[2] ** 2 else "NO"
    except:
        break

Solution (Python):
n=int(input())

while n:
    n-=1
    lis=list(map(int,input().split()))
    for i in range(3):
        for j in range(i+1,3):
            if lis[i]<lis[j]:
                a=lis[i]
                lis[i]=lis[j]
                lis[j]=a

    c,a,b=lis
    if c**2==a**2+b**2:
        print("YES")

    else:
        print("NO")

Solution (Python):
n=int(input())
for i in range(n):
    edge=input().split()
    edge=[int(j) for j in edge]
    edge.sort()

    if edge[2]**2==edge[0]**2+edge[1]**2:
        print("YES")
    else :
        print("NO")

Solution (Python):
def check_right_triangle(side1, side2, side3):
	pow = 2
	if side1**pow == side2**pow + side3**pow:
		return True
	if side2**pow == side3**pow + side1**pow:
		return True
	if side3**pow == side1**pow + side2**pow:
		return True
	return False


def check():
	for i in range(int(raw_input())):
		sides = map(int, raw_input().split())
		if check_right_triangle(sides[0], sides[1], sides[2]):
			print "YES"
		else:
			print "NO"



if __name__ == "__main__":
	check()

Solution (Python):
import sys

raw_input()

for line in sys.stdin.readlines():
    a, b, c = map(int, line.strip().split())
    input_list = [a, b, c]
    input_list.sort()
    if input_list[2] ** 2 ==  input_list[0] ** 2 + input_list[1] ** 2:
    	print 'YES'
    else:
    	print 'NO'

Solution (Python):
import sys

n = int(sys.stdin.readline())
for _ in range(n):
    a, b, c = sorted(list(map(int, sys.stdin.readline().split())))
    print('YES' if a * a + b * b == c * c else 'NO')

Solution (Python):
N = input()
for i in range(N):
	a, b, c = map(int, raw_input().split())
	t1 = a**2 + b ** 2 == c ** 2
	t2 = b**2 + c ** 2 == a ** 2
	t3 = c**2 + a ** 2 == b ** 2
	if t1 or t2 or t3:
		print("YES")
	else:
		print("NO")

Solution (Python):
import math

n = input()

for i in range(n):
    flag = 0
    a = map(int, raw_input().split())
    if(pow(a[0],2)+pow(a[1],2) == pow(a[2],2)):
        flag = 1
    if(pow(a[1],2)+pow(a[2],2) == pow(a[0],2)):
        flag = 1
    if(pow(a[2],2)+pow(a[0],2) == pow(a[1],2)):
        flag = 1
    if flag == 1:
        print "YES"
    else:
        print "NO"

Solution (Python):

def right_triangle(edge):
    
    return (edge[0] ** 2 + edge[1] ** 2 == edge[2] ** 2)

n = int(input())
for i in range(n):
    edge = sorted([int(x) for x in input().split()])
    if right_triangle(edge):
        print("YES")
    else:
        print("NO")

Solution (Python):

def right_triangle(edge):
    
    return (edge[0] ** 2 + edge[1] ** 2 == edge[2] ** 2)

n = int(input())
for i in range(n):
    edge = sorted([int(x) for x in input().split()])
    if right_triangle(edge):
        print("YES")
    else:
        print("NO")

Solution (Python):
n = int(raw_input())
for k in range(n):
    [a,b,c] = map(int,raw_input().split())
    a,b,c = sorted([a,b,c])
    if a**2 + b**2 == c**2:
        print "YES"
    else:
        print "NO"

Solution (Python):


a=int(input())

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

Solution (Python):

n = input()
for n in range(n):
    inputs = map(int,raw_input().split())
    if inputs[0]**2 == inputs[1]**2 + inputs[2]**2 or\
       inputs[1]**2 == inputs[0]**2 + inputs[2]**2 or\
       inputs[2]**2 == inputs[0]**2 + inputs[1]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
n = int(raw_input())

for i in range(n):
	temp = [int(x) for x in raw_input().split()]
	temp.sort(reverse = True)

	if temp[0] ** 2 == temp[1] ** 2 + temp[2] ** 2:
		print "YES"
	else:
		print "NO"

Solution (Python):
import sys
n = int(sys.stdin.readline())
for i in range(n):
    sides = [int(k) for k in sys.stdin.readline().split()]
    sides.sort()
    if sides[0] ** 2 + sides[1] ** 2 == sides[2] ** 2:
        print("YES")
    else:
        print("NO")

Solution (Python):
for i in range(input()):
    x=raw_input()
    L=map(int,x.split(" "))
    L.sort()
    if L[0]**2 + L[1]**2 == L[2]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
count=int(input())
for i in range(0, count):
    a = map(int, input().split(' '))
    a = [j**2 for j in a]
    a.sort()
    if (a[0] + a[1] == a[2]):
        print('YES')
    else:
        print('NO')

Solution (Python):



n = int(input())

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

Solution (Python):
N = int(raw_input())

for i in range(N):
    a = range(3)
    a[0],a[1],a[2] = map(int, raw_input().split())
    a.sort()
    if a[0]**2 + a[1]**2 == a[2]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
n = int(raw_input())
for i in range(0, n):
    li = map(int, raw_input().split())
    li.sort()
    if li[0]**2 + li[1]**2 == li[2]**2:
        print 'YES'
    else:
        print 'NO'

Solution (Python):
for i in range ( int ( input ( ) ) ):
  ( a, b, c ) = sorted ( list ( map ( int, input ( ).split ( ) ) ) )
  if ( a ** 2 ) + ( b ** 2 ) == ( c ** 2 ):
    print ( "YES" )
  else:
    print ( "NO" )

Solution (Python):
n=int(input())
for i in range(n):
        s=input().split(" ")
        s=[int(j) for j in s]
        s.sort()
        
        if(s[0]**2+s[1]**2==s[2]**2):
            print("YES")

        else:
            print("NO")

Solution (Python):

if __name__ == '__main__':
	for i in range(int(raw_input())):
		nums = map(lambda x:x**2,map(int,raw_input().split()))
		flg = False
		for i in range(3):
			s = int(0)
			for j in range(3):
				if i == j :
					continue
				s += nums[j]
			if s == nums[i] :
				flg = True

		if flg == True :
			print "YES"
		else :
			print "NO"

Solution (Python):

if __name__ == '__main__':
	for i in range(int(raw_input())):
		nums = map(lambda x:x**2,map(int,raw_input().split()))
		nums.sort()
		if nums[0]+nums[1] == nums[2]:
			print "YES"
		else :
			print "NO"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:
	print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):
for a,b,c in[sorted(map(int,raw_input().split()))for i in range(input())]:print"NO"if c*c-a*a-b*b else"YES"

Solution (Python):


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

Solution (Python):


def comp(items):
    return (items[0]**2 + items[1]**2 == items[2]**2)



def main():
    n = int(input())

    items = [0] * 3
    for tm in range(n):
        str = (input()).split()
        for i in range(3):
            items[i] = int(str[i])

        items.sort()

        if(comp(items)):
            print("YES")
        else:
            print("NO")


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    input_line = raw_input()
    N = int(input_line)
    
    for i in range(N):
        input_line = raw_input()
        num_lis = []
        for num in input_line.split(' '):
            num_lis.append(int(num))
        num_lis.sort(reverse=True)
        if num_lis[0]**2 == num_lis[1]**2 + num_lis[2]**2:
            print('YES')
        else:
            print('NO')

if __name__ == '__main__':
    main()

Solution (Python):
num=int(input())

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

Solution (Python):
numberOfDataSets = 0
sideLengthList = []

while 1:
	try:
		data = raw_input().split()

		if len(data) == 1 :
			numberOfDataSets = int(data[0])

			if numberOfDataSets != 0 :
				sideLengthList = []

		elif len(data) == 3 and numberOfDataSets != 0:
			numberOfDataSets -= 1
			sideLengthList.append(data)
 
		if numberOfDataSets == 0 :
			
			for i in range(0, len(sideLengthList)) :

				a = int(sideLengthList[i][0])*int(sideLengthList[i][0])
				b = int(sideLengthList[i][1])*int(sideLengthList[i][1])
				c = int(sideLengthList[i][2])*int(sideLengthList[i][2])

				if a + b == c or b + c == a or c + a == b :
					print"YES"
				else:
					print"NO"

	except:
		break

Solution (Python):
n = int(input())

i = 0
while (i < n):
    L = map(int, raw_input().split())
    L.sort(reverse = True)

    if (pow(L[0], 2) == pow(L[1], 2) + pow(L[2], 2)):
        print "YES"
    else:
        print "NO"

    i += 1

Solution (Python):
import sys

n = int(input())
for i in range(n):
    a = sorted(list(map(int, sys.stdin.readline().split())))
    print('YES' if a[0] ** 2 + a[1] ** 2 == a[2] ** 2 else 'NO')

Solution (Python):
n = int(input())
for i in range(n):
    a = sorted(map(int, input().split()))
    print('YES' if a[0] ** 2 + a[1] ** 2 == a[2] ** 2 else 'NO')

Solution (Python):





n = int(raw_input())
for i in range(n):
    side = sorted(map(int,raw_input().split(' ')))
    if side[0]**2 + side[1]**2 - side[2]**2:
        print 'NO'
    else:
        print 'YES'

'''
Sample Input
3
4 3 5
4 3 6
8 8 8
'''

Solution (Python):
n=input()
for i in range(0,n):
	num=map(int, raw_input().split())
	num.sort()
	a=num[0]
	b=num[1]
	c=num[2]
	if c*c==a*a+b*b:
		print "YES"
	else:
		print "NO"

Solution (Python):
num = int( input() )
for j in range( num ) :
    inputed = list(map(int, input().split()))
    maxIndex = inputed.index( max(inputed) )
    judger = 0;
    for k in range( 3 ) :
        if( maxIndex != k ) :
            judger += inputed[ k ] ** 2
    if judger == ( inputed[ maxIndex ] ** 2 ) :
        print("YES")
    else :
        print("NO")

Solution (Python):
times = int(input())

for i in range(0, times):
	edge = []
	for e in input().split(" "):
		edge.append(int(e))
	edge.sort()
	if pow(int(edge[0]), 2) + pow(int(edge[1]), 2) == pow(int(edge[2]), 2):
		print("YES")
	else:
		print("NO")

Solution (Python):
for val in range(input()):
    x = map(int,raw_input().split(' '))
    x.sort()
    if x[0]**2+x[1]**2==x[2]**2: print 'YES'
    else: print 'NO'

Solution (Python):
count = input()

for i in range(count):
	l = map(int, raw_input().split())
	l.sort()
	if(l[2]**2==l[0]**2+l[1]**2):
		print "YES"
	else:
		print "NO"

Solution (Python):
import sys

N = (int)(raw_input())
a = [0,0,0]

for i in range(N):
    a[0],a[1],a[2] = map(int,raw_input().split())
    a.sort()
    if a[0]**2 + a[1]**2 == a[2]**2:
	print("YES")
    else:
	print("NO")

Solution (Python):
N = int(input())

for i in range(N):
	num = list(map(int, input().split()))
	num.sort()
	if num[0] ** 2 + num[1] ** 2 == num[2] ** 2:
		print("YES")
	else:
		print("NO")

Solution (Python):
N = int(input())

for i in range(N):
	num = sorted(map(int, input().split()))
	if num[0] ** 2 + num[1] ** 2 == num[2] ** 2:
		print("YES")
	else:
		print("NO")

Solution (Python):
for i in range(int(input())):
    li = sorted([int(j) for j in input().split()])
    print("YES" if li[0] ** 2 + li[1] ** 2 == li[2] ** 2 else "NO")

Solution (Python):
n = int(input())
while n>0:
  l = [int(i) for i in input().split()]
  l.sort()
  if l[0]**2 + l[1] ** 2 == l[2] ** 2:
    print('YES')
  else:
    print('NO')
  n -= 1

Solution (Python):
n=input()
for i in range(n):
    a,b,c = sorted(map(int, raw_input().split()))
    if c**2 == a**2+b**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
N=int(input())
for line in range(N):
    a,b,c = (int(i) for i in input().split())
    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')

Solution (Python):
n = input()
for i in range(n):
	a, b, c = map(int, raw_input().strip().split(' '))
	if a*a+b*b == c*c or a*a+c*c == b*b or c*c+b*b == a*a:
		print "YES"
	else:
		print "NO"

Solution (Python):
import sys
size = int(sys.stdin.readline())
for i in range(size):
    line = sys.stdin.readline()
    line = line.split(" ")
    inp = []
    for j in line:
        inp.append(int(j))
    inp.sort()
    if (inp[0]**2+inp[1]**2==inp[2]**2):
        print("YES")
    else:
        print("NO")

Solution (Python):

import sys

N = int(sys.stdin.readline())
ans = []
for i in range(N):
    tri = sys.stdin.readline()[:-1].split(' ', 3)
    newlist = []
    for n in tri:
        newlist.append(int(n))
    newlist.sort()
    if newlist[0]*newlist[0] + newlist[1]*newlist[1] == newlist[2]*newlist[2]:
        ans.append("YES")
    else:
        ans.append("NO")
for a in ans:
    print(a)

Solution (Python):
for i in range(int(input())):
    a = sorted(map(int,input().split()),reverse = True)
    if a[0]**2 == a[1]**2 + a[2]**2:
        print("YES")
    else:
        print("NO")

Solution (Python):
n=int(input())
a=[]
c=[]
for i in range(n):
    a.append([])
    for j in range(3):
        a[i].append([])
for i in range(n):
    
    a[i][0], a[i][1], a[i][2]=map(int, input().split())
    a[i].sort()
    if(((a[i][0]*a[i][0])+(a[i][1]*a[i][1]))==(a[i][2]*a[i][2])):
        k="YES"
        c.append(k)
    else:
        k="NO"
        c.append(k)
for i in range(n):
    print(c[i])

Solution (Python):
n = input()
for x in xrange(n):
    sides = map(int,raw_input().split())
    sides = sorted(sides)
    if sides[0]**2+sides[1]**2==sides[2]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
n = input()
for i in xrange(n):
    li = map(int, raw_input().split())
    li.sort()    
    if li[0]**2 + li[1]**2 == li[2]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
a = int(input())
for _ in range(a):
    b, c, d = sorted(map(int, input().split()))
    if b**2+c**2 == d**2:
        print("YES")
    else:
        print("NO")

Solution (Python):
N = int(raw_input())

for n in range(N):
  data_set = map(int, raw_input().split())
  a = data_set[0]
  b = data_set[1]
  c = data_set[2]

  if (a ** 2 + b ** 2) == (c ** 2) or (a ** 2 + c ** 2) == (b ** 2) or (b ** 2 + c ** 2) == (a ** 2):
    print "YES"
  else:
    print "NO"

Solution (Python):
import sys

input()
print('\n'.join('YES' if t[0] ** 2 + t[1] ** 2 == t[2] ** 2 else 'NO' for t in
                [sorted(map(int, l.split())) for l in sys.stdin]))

Solution (Python):
N = input()
a = []
for i in range(N):
	a = map(int, raw_input().split())
	b = [0]
	for i in a:
		j = 0
		while j < 3:
			if i > b[j]:
				b.insert(j, i)
				break
			j += 1
	if b[0]**2 == b[1]**2 + b[2]**2:
		print "YES"
	else:
		print "NO"

Solution (Python):
num = int(input())
for i in range (num):
    a=sorted(list(map(int,input().split())))
    if a[0]**2+a[1]**2 == (a[2])**2:
        print("YES")
    else:
        print("NO")

Solution (Python):
import string
import sys
import math


ip = sys.stdin.readlines()
ip_list = {}


for i in range(len(ip)):
    ip_list[i] = ip[i].strip("\n").split()

for i in range(1,len(ip)):
    for j in range(3):
        
        for t in range(3):
            for k in range(3):
                if int(ip_list[i][t]) > int(ip_list[i][k]):
                    tmp = ip_list[i][t]
                    ip_list[i][t] = ip_list[i][k]
                    ip_list[i][k] = tmp  
                    
for i in range(1,len(ip)):   
    if int(ip_list[i][0])**2 == int(ip_list[i][1])**2 + int(ip_list[i][2])**2:
        print("YES")
    else:
        print("NO")

Solution (Python):
N = int(input())
ary=[]
ans=[]
for i in range(N):
    ary.append(list(map(int,(input().split()))))
    if 2 * max(ary[-1]) ** 2 == sum(ary[-1][j] ** 2 for j in range(3)):
        ans.append('YES')
    else:
        ans.append('NO')
print('\n'.join(ans))

Solution (Python):
n = int(raw_input())

for i in range(n):
    a = map(int,raw_input().split())
    a.sort()
    if (a[0]**2 + a[1]**2) == a[2]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
import sys
 
n = int(raw_input())
a = [0,0,0]
 
for i in range(n):
    a[0],a[1],a[2] = map(int,raw_input().split())
    a.sort()
    if a[0]**2 + a[1]**2 == a[2]**2:
        print("YES")
    else:
        print("NO")

Solution (Python):
n = int(raw_input())
a = [0,0,0]
 
for i in range(n):
    a[0],a[1],a[2] = map(int,raw_input().split())
    a.sort()
    if a[0]**2 + a[1]**2 == a[2]**2:
        print("YES")
    else:
        print("NO")

Solution (Python):
n = input()

for i in xrange(n):
    tmp = map(int, raw_input().split())
    if tmp[0]**2 + tmp[1]**2 == tmp[2]**2 or tmp[1]**2 + tmp[2]**2 == tmp[0]**2 or tmp[2]**2 + tmp[0]**2 == tmp[1]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):


i = input()
q = []
for n in range(i):
    l = map(int, raw_input(). split())
    a = min(l)
    l.remove(min(l))
    b = min(l)
    c = max(l)
    if a ** 2 + b ** 2 == c ** 2:
        q.append("YES")
    else:
        q.append("NO")

for s in xrange(len(q)):
    print(q[0])
    q.pop(0)

Solution (Python):
n=int(input())
for i in range(n):
	A=[int(j) for j in input().split()]
	A.sort()
	if A[0]**2+A[1]**2==A[2]**2:
		print("YES")
	else:
		print("NO")

Solution (Python):
x = input()
for i in xrange(x):
    inp = map(int ,raw_input().split())
    inp.sort()

    if inp[2]**2 == inp[0]**2 + inp[1]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
n = int(input())
for i in range(n):
    s = input().split(" ")
    s = [int(j) for j in s]
    s.sort()
    a = s[0]
    b = s[1]
    c = s[2]

    if(a**2+b**2==c**2):
        print("YES")
    else:
        print("NO")

Solution (Python):
N=int(input())
for n in range(N):
	sides = list(map(int,input().split()))
	sides.sort()
	if sides[-1]**2 == sides[-2]**2 + sides[-3]**2:
		print("YES")
	else:
		print("NO")

Solution (Python):


N = int(raw_input())
for i in range(N):
    a, b, c = map(int, raw_input().split())
    if a > c:
        a, c = c, a
    if b > c:
        b, c = c, b
    if a*a+b*b == c*c:
        print "YES"
    else:
        print "NO"

Solution (Python):
n = int(input())
for cnt in range(n):
    t = list(map(int, input().split()))
    t.sort()
    if t[2]**2 == t[1]**2 + t[0]**2:
        print('YES')
    else:
        print('NO')

Solution (Python):


N = int(raw_input())

dataList = []
for i in range(N):
    list = map(int, raw_input().split())
    dataList.append(list)


for i in range(len(dataList)):
    idx = dataList[i].index(max(dataList[i]))
    lar = dataList[i][idx]
    del dataList[i][idx]
    if lar**2 == dataList[i][0] ** 2 + dataList[i][1]**2:
        print "YES"
    else:
        print "NO"

Solution (Python):
n = int(input())

for i in range(n):
    a,b,c = map(int,input().split(" "))
    if a**2 == b**2 + c**2:
        print("YES")
    elif b**2 == a**2 + c**2:
        print("YES")
    elif c**2 == a**2 + b**2:
        print("YES")
    else:
        print("NO")

Solution (Python):


n = int(input())
for i in range(n):
    set = input(). split()
    set = [int(a) for a in set] 
    set.sort()
    if set[0] ** 2 + set[1] ** 2 == set[2] ** 2:
        print("YES")
    else:
        print("NO")

Solution (Python):
delta = int(input())
tri_all = []
for i in range(delta):
	tri = list(map(int, input().split(' ')))
	tri.sort()
	tri_all.append(tri)

for i in range(len(tri_all)):
	if tri_all[i][0]**2 + tri_all[i][1]**2 == tri_all[i][2]**2:
		print('YES')
	else:
		print('NO')

Solution (Python):
n=input()
for i in  xrange(n):
    a,b,c=map(int,raw_input().split())
    if a**2+b**2==c**2 or a**2+c**2==b**2 or b**2+c**2==a**2:
        print('YES')
    else:
        print('NO')

Solution (Python):
def check(List):
    List.sort()
    List.reverse()
    if List[0]**2 == List[1]**2+List[2]**2:
        return "YES"
    else:
        return "NO"

N = input()
    
for i in range(N):
    list = map(int, raw_input().split())
    print check(list)

Solution (Python):


def get_input():
    for i in range(int(input())):
        yield "".join(input())

if __name__ == "__main__":
    array = list(get_input())
    
    for i in range(len(array)):        
        a,b,c = array[i].split()
        if int(a)**2 + int(b)**2 == int(c)**2:
            print(u"YES")
        elif int(c)**2 + int(a)**2 == int(b)**2:
            print(u"YES")
        elif int(b)**2 + int(c)**2 == int(a)**2:
            print(u"YES")
        else:
            print(u"NO")

Solution (Python):


def main():
	num = int(input())
	for i in range(num):
		tri = [int(x) for x in input().split(" ")]
		tri.sort()
		if tri[2] ** 2 == tri[0] ** 2 + tri[1] ** 2:
			print("YES")
		else:
			print("NO")
			
if __name__ == '__main__':
  main()

Solution (Python):
import itertools
import operator

line = int(input())
inputs = [input() for _ in range(line)]

def is_right_triangle(a, b, c):
    a, b, c = list(sorted([a,b,c]))
    return a**2 + b**2 == c**2

for line in inputs:
    a, b, c = line.split()
    print("YES" if is_right_triangle(int(a), int(b), int(c)) else "NO")

Solution (Python):
for i in range(int(input())):
    a,b,c = map(int, input().split())
    if a**2 + b**2 == c**2 or a**2+c**2 == b**2 or b**2+c**2 == a**2:
        print("YES")
    else:
        print("NO")