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:
N = int(input())

for i in range(N):
    a, b, c = map(int, input().split())
    list = [a, b, c]
    for j in range(2,0,-1):
        for k in range(j):
            if list[k]<list[k+1]:
                list[k], list[k+1] = list[k+1], list[k]
    if (list[0])**2 == (list[1])**2 + (list[2])**2 :
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N):
    x,y,z = map(int,input().split())
    if x>y and x>z:
        s = y**2+z**2
        u = x**2
        if s==u:
            print("YES")
        else:
            print("NO")
    elif y>x and y>z:
        s = x**2+z**2
        u = y**2
        if s==u:
            print("YES")
        else:
            print("NO")
    else:
        s = x**2+y**2
        u = z**2
        if s==u:
            print("YES")
        else:
            print("NO")
    i += 1

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
    a,b,c = sorted(map(int,input().split()))
    if a*a + b*b == c*c:
        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 a*a+c*c==b*b or b*b+c*c==a*a:
        print("YES")
    else :
        print("NO")

Submission status: Accepted

Solution code:
N=int(input())
i=0
while i<N:
    a,b,c=map(int,input().split())
    if a>b:
        a,b=b,a
    if b>c:
        b,c=c,b
    if a>b:
        a,b=b,a
    if a**2+b**2==c**2:
        print('YES')
    else:
        print('NO')
    i+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
while True:
    try:
        a=list(map(int,input().split()))
        if a[0]**2+a[1]**2==a[2]**2:
            print('YES')
        elif a[1]**2+a[2]**2==a[0]**2:
            print('YES')
        elif a[2]**2+a[0]**2==a[1]**2:
            print('YES')
        else:
            print('NO')
    except:
        break;

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())

i = 1
while i <= N:
    a, b, c = map(int, input(). split())
    if a*a == b*b + c*c:
        print("YES")
    elif b*b == a*a + c*c:
        print("YES")
    elif c*c == a*a + b*b:
        print("YES")
    else:
        print("NO")
    i += 1

Submission status: Accepted

Solution code:
N=int(input())
for i in range(N) :
    x,y,z=map(int,input().split())
    if x**2==z**2+y**2:
        print('YES')
    elif y**2==x**2+z**2:
        print('YES')
    elif z**2==x**2+y**2:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
x=input()
i=0
while int(x)>i :
    a,b,c=input().split()
    a=int(a)
    b=int(b)
    c=int(c)
    if a*a==b*b+c*c or b*b==c*c+a*a or c*c==b*b+a*a :
        print("YES")
    else :
        print("NO")
    i=i+1

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
n=int(input())
i=1

while i<=n:
    a,b,c=map(int, input().split())
    if a<b:
        a,b=b,a
    if a<c:
        a,c=c,a
    if a**2==b**2+c**2:
        print("YES")
    else:
        print("NO")
    
    i+=1

Submission status: Accepted

Solution code:
r=int(input())

for x in range(r):
    a,b,c=map(int,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=int(input())

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

Submission status: Accepted

Solution code:
n=int(input())
for i in range(n):
    l=list(map(int,input().split()))
    if l[0]*l[0]+l[1]*l[1] == l[2]*l[2]:
        print("YES")
    elif l[2]*l[2]+l[1]*l[1] == l[0]*l[0]:
        print("YES")
    elif l[0]*l[0]+l[2]*l[2] == l[1]*l[1]:
        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>b:
        a,b=b,a
    if b>c:
        b,c=c,b
    if a>c:
        a,c=c,a
    if a**2+b**2==c**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:

result = []
N = int(input())

for i in range(N):
    A = list(map(int, input().split()))
    chk_Num = sorted(A, reverse=True)
    if (chk_Num[1] ** 2 + chk_Num[2] ** 2) == (chk_Num[0] ** 2):
        result.append("YES")
    else:
        result.append("NO")

for i in result:
    print(i)

Submission status: Accepted

Solution code:
N=int(input())
for i in range(1,N+1):
    x,y,z=input().split()
    x=int(x)
    y=int(y)
    z=int(z)
    if x>y:
        x,y=y,x
    if y>z:
        y,z=z,y
    if x>y:
        x,y=y,x
    if x*x+y*y==z*z:
        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:
count= int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

for i in range(N):
    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:
N = int(input())

for i in range(N) :
    a, b, c = map(int, input().split())
    L = [a, b, c]
    
    m = L.pop(L.index(max(L)))
    s = L[0] ** 2 + L[1] ** 2
    
    if m ** 2 == s :
        print("YES")
    else :
        print("NO")

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N):
  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:
import sys
i=0
N=int(input())
while i<N:
        a,b,c= map(int, input().split())
        a2=a*a
        b2=b*b
        c2=c*c
        if(a2==b2+c2 or b2==a2+c2 or c2==b2+a2):
            print('YES')
        else:
            print('NO')
        i=i+1

Submission status: Accepted

Solution code:
loop_len = int(input())
import math
for i in range(loop_len):
    l=list(map(int,input().split()))
    if math.hypot(l[0],l[1])==l[2]:
        print('YES')
    elif math.hypot(l[1],l[2])==l[0]:
        print('YES')
    elif math.hypot(l[2],l[0])==l[1]:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judgeTriangle(a, b, c):
    if c * c == a * a + b * b:
        result = 'YES'
    else:
        result = 'NO'
    return result


for i in range(int(input())):
    numList = list(map(int, input().split()))
    numList.sort()
    a, b, c = numList
    print(judgeTriangle(a, b, c))

Submission status: Accepted

Solution code:
n = int(input())

for _ in range(n):
    triangle = list(map(int, input().split()))
    triangle = list(reversed(sorted(triangle)))

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

Submission status: Accepted

Solution code:
time = int(input())

while time > 0 :
    a,b,c = (int(x) for x 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")
    
    time -= 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
try:
    while True:
        a, b, c = map(int, input().split())
        if (a**2 == b**2 + c**2) or (b**2 == a**2 + c**2) or (c**2 == b**2 + a**2) :
            print("YES")
        else:
            print("NO")
except EOFError:
    pass

Submission status: Accepted

Solution code:
N=int(input())
l=[list(map(int,input().split())) for i in range(N)]

for i in l:
  i.sort()
  if (i[-1])**2 == (i[-2])**2 + (i[-3])**2:
    print("YES")
  else:print("NO")

Submission status: Accepted

Solution code:
t = int(input())
i = 0
def Right_Tri(m,n,o):
    a = (n**2+o**2)**(0.5)
    if m == a:
        return True

while(i<t):
    m,n,o = map(int, input().split())
    if (Right_Tri(m,n,o) or Right_Tri(n,o,m) or Right_Tri(o,m,n) == True):
        print("YES")
    else:
        print("NO")
    i += 1

Submission status: Accepted

Solution code:
N = int(input())

array = []
for _ in range(0, N):
    array.append(map(int, input().split(' ')))

for a, b, c in array:
    a = a ** 2
    b = b ** 2
    c = c ** 2
    if a + b == c or b + c == a or c + a == b:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
while True:
    try:
        num = int(input())
        for i in range(num):
            lengths = (int(x) for x in input().split())
            sortLengths = sorted(lengths)
            
            if(sortLengths[2] * sortLengths[2] == (sortLengths[1] * sortLengths[1]) + (sortLengths[0] * sortLengths[0])):
                print("YES")
            else:
                print("NO")
    except EOFError:
        break

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    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:
n=int(input())
for i in range(n):
    t=list(map(int,input().split()))
    t.sort()
    a,b=t[0]**2+t[1]**2,t[2]**2
    if a==b:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
print("\n".join("YES" if max(x) * 2 == sum(x) else "NO" for _ in range(int(input())) for x in [list(map(lambda x: int(x)**2, input().split()))]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
def check_right_triangle(l):
    ans = ""
    max_number = l.pop(l.index(max(l)))
    if((max_number**2) == (l[0]**2+l[1]**2)):
        return "YES"
    else:
        return "NO"
for i in range(N):
    length_of_three_side = list(map(int,input().split()))
    print(check_right_triangle(length_of_three_side ))

Submission status: Accepted

Solution code:
n=int(input())
N=[]
for i in range(n):
  N.append(list(map(int,input().split())))

for x,y,z in N:
  if x**2+y**2==z**2 or x**2+z**2==y**2 or z**2+y**2==x**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()
    print('YES' if num[0]**2 + num[1]**2 == num[2]**2 else 'NO')

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    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:
for _ in[0]*int(input()):a,b,c=sorted(map(int,input().split()));print(['NO','YES'][a*a+b*b==c*c])

Submission status: Accepted

Solution code:
T = int(input())
for tc in range(0,T):
  a = sorted(map(int, 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())
for i in range(N):
    l = list(map(int,input().split()))
    l.sort()
    if l[0]*l[0]+l[1]*l[1] == l[2]*l[2]: print("YES")
    else: print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
T = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for i in range(int(input())):
    tri = [int(i) for i in input().split(' ')]
    tri.sort()
    if tri[0]**2 + tri[1]**2 == tri[2]**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) or (b**2 == a**2 + c**2) or (c**2 == a**2 + b**2):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
T = int(input())
for tc in range(0,T) :
    a=sorted(map(int,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())

for i in range(n):
    x = [int(i) for i 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:
for _ 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")

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
for i in range(n):
    a,b,c = list(map(int,input().split()))
    if a*a == b*b + c*c or b*b == c*c + a*a or c*c == a*a + b*b:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
    a = [int(s) for s in input().split()]
    a = sorted(a)
    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):
  a,b,c=map(int,input().split())
  l=[a,b,c]
  list.sort(l)
  if l[0]**2+l[1]**2==l[2]**2:
    print("YES")
  else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for i in range(int(input())):
    a = [int(i) for i 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:
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:
n = int(input())
for i in range(n):
  A =list(map(int,input().split()))
  A.sort()
  a=A[0]
  b=A[1]
  c=A[2]
  if c*c == a*a + b*b:
    print("YES")
  else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':

	n = int(input())
	for _ in range(n):
		n,m,s = map(int,input().split())
		if n*n == m*m + s*s or m*m == n*n + s*s or s*s == m*m + n*n:
			print("YES")
		else:
			print("NO")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
  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:
for i in range(int(input())):
    data = input().split()

    length = []
    for j in range(3):
        length.append(int(data[j]))
    length.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge(a, b, c):
	if a*a + b*b == c*c: return 'YES'
	else: return 'NO'
N = int(raw_input())
for i in range(0, N):
	side = map(int, raw_input().split())
	side.sort()
	print judge(side[0], side[1], side[2])

Submission status: Accepted

Solution code:
n = int(input())
length = [[]*3]*n
for i in range(n):
    length[i] = input().split()

for i in range(n):
    
    if int(length[i][0])**2 == int(length[i][1])**2 + int(length[i][2])**2:
        print("YES")
        continue

    if int(length[i][1])**2 == int(length[i][2])**2 + int(length[i][0])**2:
        print("YES")
        continue

    if int(length[i][2])**2 == int(length[i][0])**2 + int(length[i][1])**2:
        print("YES")
        continue
    
    print("NO")

Submission status: Accepted

Solution code:
N=int(input())
for i in range(N):
    a=sorted(map(int,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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

n = int(input())

for line in sys.stdin.readlines():
    i = line.rstrip().split(' ')
    a = pow(int(i[0]),2)
    b = pow(int(i[1]),2)
    c = pow(int(i[2]),2)
    if ((a+b) == c) or ((b+c)==a) or ((c+a)==b):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n):
  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:
var1 = int(input()) + 1
list3 = []
for i in range(1, var1):
    list3.append(input())
for m in range(0, var1-1):
    str1 = list3[m]
    list1 = str1.split(" ")
    list1 = list(map(int, list1))
    var2 = max(list1)
    list1.remove(max(list1))
    var2 = var2 * var2
    var3 = list1[0]*list1[0]
    var4 = list1[1]*list1[1]
    if var4 + var3 == var2:
        print("YES")
    else:
        print("NO")
    list1.clear()
    str1 = None

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_num = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge_triangle(edges):
    edges.sort(reverse = True)
    if edges[0]**2 == edges[1]**2 + edges[2]**2:
        return 'YES'
    else:
        return 'NO'

lines = int(input())

for i in range(lines):
    edges = list(map(int, raw_input().split()))
    print judge_triangle(edges)

Submission status: Accepted

Solution code:
#import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h=int(input())
for i in range(0, h):
	n=list(map(int, input().split()))#ファイルの読み込み --.py <--.txt
	a=n[0]
	b=n[1]
	c=n[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:
import sys

datasets = int(input())

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

Submission status: Accepted

Solution code:
n = int(input() )
for i in range(n):
    a, b, c = [int(x) for x in input().split()]
    if (b > a):
        a, b = b, a
    if (c > a):
        a, c = c, a #a = max
    if (b*b + c*c - a*a == 0):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
N=int(input())
triangle=[]

for i in range(N):
    triangle.append(list(map(int,input().split())))

for i in range(N):
    if pow(triangle[i][0],2)+pow(triangle[i][1],2)+pow(triangle[i][2],2)==2*pow(max(triangle[i]),2):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = int(input())
for j in range(i):
    a,b,c = [int(i) for i in input().split()]
    if a**2+b**2==c**2 or abs(a**2-b**2)==c**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n = int(input())
ans = []

for _ in range(n):

    l = list(map(int, input().split()))
    l.sort()
    a = l[0]
    b = l[1]
    c = l[2]

    if c**2 == a**2 + b**2:
        ans.append("YES")
    else:
        ans.append("NO")


for a in ans:
    print(a)

Submission status: Accepted

Solution code:
def Triangle(a,b,c):
    if a**2 == b**2 +c**2 or b**2 == a**2+c**2 or c**2 == a**2+b**2:
        print("YES")
    else:
        print("NO")

N = int(input())
for i in range(N):
    a,b,c = map(int,input().split())
    Triangle(a,b,c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
for _ 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:
def isRightTri(list):
    list.sort()
    if list[2]**2 == list[0]**2 + list[1]**2:
        return True
    else:
        return False

n = int(input())
ans = []
for i in range(n):
    a = list(map(int,input().split()))
    ans.append(isRightTri(a))
for i in range(n):
    if ans[i]:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
import math

num = int(input())

for i in range(num):
    try:
        sides = list(map(int, input().split(" ")))
        sides.sort()

        if int(math.pow(sides[0], 2)) + int(math.pow(sides[1], 2)) == int(math.pow(sides[2], 2)):
            print("YES")
        else:
            print("NO")

    except:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = []

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

Submission status: Accepted

Solution code:
s = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
ans = []
for i in range(n):
    a, b, c = map(int, (input()).split(" "))
    if 2*max(a, b, c)**2 == a**2+b**2+c**2:
        ans.append("YES")
    else:
        ans.append("NO")
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
n=input()

for _ in range(n):
 a=sorted(map(int, raw_input().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(0, N):
    edge = list(map(int, input().split()))
    edge.sort()
    edge = list(map(lambda n:n*n, edge))
        
    if (edge[2] == edge[0] + edge[1]):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
	tr = list(map(int, input().split()))
	c = max(tr)
	tr.remove(c)
	wa = sum(map((lambda x: x**2), tr))
	if c**2 == wa: print('YES')
	else: print('NO')

Submission status: Accepted

Solution code:
num = int(input())
output = []
data = []

for x in range(num):
    data = input().split()
    for y in range(len(data)):
        data[y] = int(data[y])
    data.sort()
    if data[2]**2 == data[1]**2 + data[0]**2:
        output.append("YES")
    else:
        output.append("NO")

for x in range(num):
    print(output[x])