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



Sample input:
3
4 3 5
4 3 6
8 8 8


Sample output:
YES
NO
NO

Submission status: Accepted

Solution code:

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


# main function
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()

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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 :
			# Is it a right triangle?
			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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
# coding: utf-8
#Problem Name: Is it a Right Triangle?
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

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

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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'

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
#! /usr/bin/env python3.4
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)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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):
    #for j in range(3):
    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])

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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]))

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
import string
import sys
import math

#??????????????\????????????ip?????\??????
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")

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
#coding:utf-8

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)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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"

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(raw_input())

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

# find max number
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"

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
#Is it Right Triangre?

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
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()

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
n=int(input())
a_list=[]
for i in range(n):
	k=list(map(int,input().split(" ")))
	L,M,N=sorted(k)
	if L**2+M**2==N**2:
		a_list.append("YES")
	else:
		a_list.append("NO")
for i in a_list:
	print(i)

Submission status: Accepted

Solution code:
import sys
r = []
n = int(input())
l = sys.stdin.readlines()
for i in l:
  x, y, z = sorted(map(lambda x:x*x,map(int, i.split())))
  if x + y == z:
      print("YES")
  else:
      print("NO")

Submission status: Accepted

Solution code:
import sys

n = int(input())
l = sys.stdin.readlines()
s = ""
for i in l:
  x, y, z = sorted(map(lambda x:x*x,map(int, i.split())))
  if x + y == z:
      s += "YES\n"
  else:
      s += "NO\n"

print(s,end="")

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline())
l = sys.stdin.readlines()
s = ""
for i in l:
  x, y, z = sorted(map(lambda x:x*x,map(int, i.split())))
  if x + y == z:
      s += "YES\n"
  else:
      s += "NO\n"

print(s,end="")

Submission status: Accepted

Solution code:
n = int(input())
s = ""
for i in range(n):
  l = list(map(lambda x:x*x,map(int, input().split())))
  l.sort()
  if l[0] + l[1] == l[2]:
      s += "YES\n"
  else:
      s += "NO\n"

print(s,end="")

Submission status: Accepted

Solution code:
# coding: utf-8
num = int(input())
for i in range(num):
    ls = list([int(i) for i in input().split()])
    ls.sort()
    if ls[0]**2 + ls[1]**2 == ls[2]**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
line = int(input())
for i in range(line):
	a,b,c = sorted([int(i) for i in input().split(' ')])

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

Submission status: Accepted

Solution code:
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'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    side = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
def IsRightTriangle(tri):
	tri.sort()
	return tri[0]**2 + tri[1]**2 == tri[2]**2

N = eval(input())
for i in range(N):
	tri = [eval(item) for item in input().split()]
	print('YES' if IsRightTriangle(tri) else 'NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = []
for i in range(N):
    a = list(map(int, input().split()))
 
    side_a = a[0]
    side_b = a[1]
    side_c = a[2]
    if side_a ** 2 + side_b ** 2 == side_c ** 2 \
        or side_c ** 2 + side_b ** 2 == side_a ** 2 \
        or side_a ** 2 + side_c ** 2 == side_b ** 2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
import sys

def is_right(edges):
    max_len = max(edges)
    edges.remove(max_len)
    return max_len ** 2 == edges[0] ** 2 + edges[1] ** 2
    
num = int(sys.stdin.readline().strip())

for i in range(num):
    data = sys.stdin.readline().strip().split(' ')
    a = int(data[0])
    b = int(data[1])
    c = int(data[2])
    if is_right([a, b, c]):
        print('YES')
    else:
        print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def d(a):
	return int(a)

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

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    try:
        a,b,c = [int(x) for x in line.split()]
        if (a**2+b**2) == c**2:
            print('YES')
        elif (a**2+c**2) == b**2:
            print('YES')
        elif (b**2+c**2) == a**2:
            print('YES')
        else:
            print('NO')
    except(ValueError):
        continue

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    try:
        a,b,c = [int(x) for x in line.split()]
        if (a**2+b**2) == c**2:
            print('YES')
        elif (a**2+c**2) == b**2:
            print('YES')
        elif (b**2+c**2) == a**2:
            print('YES')
        else:
            print('NO')
    except(ValueError):
        continue

Submission status: Accepted

Solution code:
num=int(input())
for i in range(num):
    list=[int(i) for i in input().split()]
    list.sort();
    if pow(list[0],2) + pow(list[1],2) == pow(list[2],2):
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
import sys

n = input()
for a,b,c in map(lambda x: sorted(map(int,x.split())),sys.stdin.readlines()):
    print("YES" if a*a+b*b==c*c else "NO")

Submission status: Accepted

Solution code:
import sys

input()
for a,b,c in map(lambda x: sorted(map(int,x.split())),sys.stdin.readlines()):
    if a**2 + b**2 == c**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:UTF-8
def Rec(N,List):
    for i in range(N):
        a=int(List[i].split(" ")[0])
        b=int(List[i].split(" ")[1])
        c=int(List[i].split(" ")[2])
        if a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a:
            print("YES")
        else:
            print("NO")

if __name__=="__main__":
    List=[]
    N=int(input())
    for i in range(N):
        List.append(input())
    Rec(N,List)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
L = [input() for i in range(n)]
for line in L:
	A = line.split()
	B = sorted([int(A[i]) for i in range(3)])
	if B[2]**2 == B[0]**2 + B[1]**2:
		print('YES')
	else:
		print('NO')

Submission status: Accepted

Solution code:
N = int(input())

for i in range(N):
    line = input()
    a, b, c = sorted(int(w) for w in line.split())

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

Submission status: Accepted

Solution code:
def isRTri(a, b, c):
    return a * a + b * b == c * c

a = [0, 0, 0]
n = input()
for k in range(n):
    a = map(int, raw_input().split())
    a.sort()
    r = isRTri(a[0], a[1], a[2])
    print "YES" if r else "NO"

Submission status: Accepted

Solution code:
import sys
n = int(input())
for i in range(n):
    ns = [x * x for x in map(int, input().split())]
    if ns[0] + ns[1] == ns[2] or ns[0] + ns[2] == ns[1] or ns[1] + ns[2] == ns[0]:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n=int(input())
for i in range(n):
    hens=[int(i) for i in input().split(" ")]
    t=max(hens)
    hens.remove(t)
    if t**2==hens[0]**2+hens[1]**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

def is_right_triangle(hypotenuse, x, y):
    if x**2 + y**2 == hypotenuse**2:
        return True
    return False

def main():
    N = int(input())
    for i in range(N):
        length = [int(n) for n in input().split()]
        length.sort(reverse=True)
        ret = 'YES' if is_right_triangle(*length) else 'NO'
        print(ret)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
while N > 0:
    es = sorted(list(map(int, input().split())))
    if es[2] ** 2 == es[1] ** 2 + es[0] ** 2:
        print('YES')
    else:
        print('NO')
    N -= 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[print("YES" if y[0] + y[1] == y[2] else "NO") for y in [sorted([int(x)**2 for x in input().split()]) for _ in range(int(input()))]]

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
	edges = list(map(int, input().split()))
	if len(edges) == 0:
		break
	edges.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8

n = raw_input()
a = []
for i in range(int(n)):
    l = map(int,raw_input().split())
    a.append(l)

for l in a:
    l = [x * x for x in l]
    l.sort()
    if l[0] + l[1] == l[2]:
        print 'YES'
    else:
        print 'NO'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cnt = int(input())
values = []
for i in range(cnt):
    values.append([int(x) for x in input().split()])

for x, y, z in values:
    if z ** 2 == x ** 2 + y ** 2:
        print('YES')
    elif x ** 2 == y ** 2 + z ** 2:
        print('YES')
    elif y ** 2 == x ** 2 + z ** 2:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    # ??????????????\???
    num = int(input())
    triangles = []
    for i in range(num):
        triangles.append([int(x) for x in input().split(' ')])

    # ??´?§?????§???¢?????????????????????
    results = []
    for t in triangles:
        t.sort()
        if t[0]**2 + t[1]**2 == t[2]**2:
            results.append('YES')
        else:
            results.append('NO')

    # ???????????????
    for r in results:
        print(r)

Submission status: Accepted

Solution code:
triangle = []
n = int(input())
for i in range(n):
    try:
        (a,b,c) = input().split(" ")
        triangle.append((a,b,c))
    except:
        break
for (a,b,c) in triangle:
    if (int(a)**2 + int(b)**2 == int(c)**2) or (int(b)**2 + int(c)**2 ==int(a)**2) or (int(a)**2 + int(c)**2 == int(b)**2) :
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n = int(input())

for i in range(n):
    a,b,c = list(map(int, input().split()))
    M = max([a,b,c])
    result = False
    if a == M:
        result = (a * a == b * b + c * c)
    elif b == M:
        result = (b * b == a * a + c * c)
    elif c == M:
        result = (c * c == a * a + b * b)
    if result:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
n = int(input())

for _ in range(n):
    a = [int(i) ** 2 for i in input().split()]
    if max(a) == (sum(a) - max(a)):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

import sys

array = []
for i in sys.stdin:
    array.append(i)

N = int(array[0])
for k in range(1,N+1):
    x = array[k].split()
    a, b, c = int(x[0]), int(x[1]), int(x[2])
    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')

Submission status: Accepted

Solution code:
def main():
    n = input()
    for _ in range(0,n):
        arr = map(int,raw_input().split())
        arr.sort()
        if arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1]:
            print "YES"
        else:
            print "NO"

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(raw_input())
#print n

while True:
    try:
        a = map(int, raw_input().split())
        #print a
        a.sort(reverse=True)
        #print a

        b, c, d = a
        if (b * b) == ((c * c) + (d * d)):
            print 'YES'
        else:
            print 'NO'
    except EOFError:
        break;