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):
    c,d,b=map(int,input().split())

    if c*c+d*d==b*b or c*c+b*b==d*d or b*b+d*d==c*c:
        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:
import sys
input()
for e in sys.stdin:
 a,b,c=sorted(map(int,e.split()))
 print(['NO','YES'][a*a+b*b==c*c])

Submission status: Accepted

Solution code:
import sys
input()
for e in sys.stdin:
    a, b, c = sorted(map(int, e.split()))
    if a**2 + b**2 == c**2:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
import sys
input()
for a,b,c in map(lambda x:sorted(map(int,x.split())),sys.stdin):
 print(['NO','YES'][a*a+b*b==c*c])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
    edges = sorted([int(i) for i in input().split()])
    if edges[0] ** 2 + edges[1] ** 2 == edges[2] ** 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**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:
while True:
    n = int(input())
    if n <= 1000:
        break

for i in range(1, n+1):
    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:
# AOJ通らなかった...何故かはわからん
N = int(input())
for i in range(N):
    a = list(map(int, input().split(" ")))
    a.sort()
    #print(a)
    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):
    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:
n = int(input())
for i in range(n):
	li  = sorted(map(int, input().split()))
	if(pow(li[0], 2) + pow (li[1], 2) == pow(li[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()
	print("YES" if l[0]**2+l[1]**2==l[2]**2 else "NO")

Submission status: Accepted

Solution code:
def solve():
    data = read()
    result = think(data)
    write(result)


def read():
    n = int(input())
    data = []
    for i in range(n):
        data.append(read_data())
    return data


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


def think(data):
    result = []
    for d in data:
        if is_right_triangle(d):
            result.append('YES')
        else:
            result.append('NO')
    return result


def is_right_triangle(d):
    x, y, z = d[0], d[1], d[2]
    return (x ** 2 == y ** 2 + z ** 2) or (y ** 2 == z ** 2 + x ** 2) or (z ** 2 == x ** 2 + y ** 2)


def write(result):
    for r in result:
        print(r)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
for i 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())):
    temp = [int(x) for x in input().split()]
    stemp = sorted(temp)
    if stemp[2]**2 == stemp[1]**2 + stemp[0]**2:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
s = int(input())

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

Submission status: Accepted

Solution code:
input()
while True:
  try:
    lst = list(map(int,input().split()))
    lst.sort()
    if lst[2] ** 2 == lst[1] ** 2 + lst[0] ** 2:
      print("YES")
    else:
      print("NO")
  except EOFError:
    break

Submission status: Accepted

Solution code:
import collections
import sys

def read_prob():
    inputs = []
    try:
        counter = 0
        while True:
            if counter == 0:
                line = input().strip()
                size = int(line)
            else:
                line = input().strip().split()
                a, b, c = line[0], line[1], line[2]
                inputs.append([int(a),  int(b), int(c)])
            counter += 1
    except EOFError:
        pass
    return inputs

def triangle(inputs):
    f = lambda x: x * x
    inputs = list(map(f, inputs))
    # print(inputs)
    a, b, c = inputs[0], inputs[1], inputs[2]
    if a + b == c:
        return True
    elif a + c == b:
        return True
    elif b + c == a:
        return True
    else:
        return False

if __name__ == '__main__':
    inputs = read_prob()
    for inp in inputs:
        if triangle(inp):
            print("YES")
        else:
            print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

Solution code:
N=int(input())
a=[0,0,0]
for i in range(N):
    a[0],a[1],a[2] = 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=input()
for i in range(N):
	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"

Submission status: Accepted

Solution code:

N = int(input())
A = []
B = []
C = []#最長辺
for i in range(N):
    a, b, c = map(int, input().split())
    if(a > b):#a,bを昇順に並び替える
        t = a
        a = b
        b = t
    if(b > c):#b,cを昇順に並び替える
        t = b
        b = c
        c = t
    A.append(a)
    B.append(b)
    C.append(c)
for i in range(N):
    if(A[i]**2 + B[i]**2 == C[i]**2):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
for _ in range(int(input())):
    e = list(map(int, input().split()))
    print("YES" if max(e) ** 2 * 2 == sum(i ** 2 for i in e) else "NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:

round = int(input(""))
for i in range (0,round):
    arr = []
    temp = input("")
    a,b,c = temp.split(" ")
    arr.append(int(a))
    arr.append(int(b))
    arr.append(int(c))
    arr.sort()
    if(pow(arr[0],2)+pow(arr[1],2)==pow(arr[2],2)):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# AOJ 0003 Is it a Right Triangle?
# Python3 2018.6.7 bal4u

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

Submission status: Accepted

Solution code:
# AOJ 0003 Is it a Right Triangle?
# Python3 2018.6.7 bal4u

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())):
    llist = list(map(int,input().split()))
    llist.sort()
    if(llist[2]**2 == llist[0]**2 + llist[1]**2):
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
def judge(lists):
    lists.sort()
    if lists[0] ** 2 + lists[1] ** 2 - lists[2] ** 2:
        return False
    else:
        return True


def run():
    N = int(input())
    for _ in range(N):
        if judge([int(x) for x in input().split()]):
            print("YES")
        else:
            print("NO")

if __name__ == '__main__':
    run()

Submission status: Accepted

Solution code:
def run():
    n = int(input())
    data = []
    for _ in range(n):
        data.append(list(map(int, input().split())))

    for d in data:
        _data = d[:]
        mx = max(_data)
        _data.remove(mx)
        if mx**2 == sum([x**2 for x in _data]):
            print('YES')
        else:
            print('NO')
        

if __name__ == '__main__':
    run()

Submission status: Accepted

Solution code:
print "\n".join(s for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO', [sorted(int(x)**2 for x in raw_input().split(' ')) for i in range(int(raw_input()))]))

Submission status: Accepted

Solution code:
n = int(raw_input())

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

Submission status: Accepted

Solution code:
x = int(input())
for a in range(x):
 y = map(int,raw_input().split())
 y.sort()
 if y[2]**2-y[1]**2 == y[0]**2:
  print "YES"
 else:
  print "NO"

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
num = int(raw_input())
for i in range(num):
    list = [int(x) for x in raw_input().split(" ")]
    list.sort(lambda n1, n2:n2 - n1)
    if list[0]**2 == list[1]**2 + list[2]**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())

def check(num_list):
    largest = max(num_list)
    largest_idx = num_list.index(largest)
    tmp = sum([pow(x, 2) for i, x in enumerate(num_list) if i != largest_idx])
    if tmp == pow(largest, 2):
        return "YES"
    else:
        return "NO"

for i in xrange(N):
    line = sys.stdin.readline()
    num_list = map(int, line.strip().split())
    print "{0}".format(check(num_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:UTF-8

c = int(raw_input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def pgr(x, y, z):
    if x**2 + y**2 == z**2: return True
    else: return False
    
while 1:
    try:
        n = input()
        for i in range(n):
            a,b,c = map(int, raw_input().split())
            if (pgr(a,b,c) or pgr(b,c,a) or pgr(c,a,b)): print 'YES'
            else: print 'NO'
        break
    except EOFError:
        break

Submission status: Accepted

Solution code:

nums = input()
lines = [[]]*nums

for x in range(nums):
    lines[x] = map(int, raw_input().split(' '))


for li in lines:
    li.sort()

for li in lines:
    if li[0]**2 + li[1]**2 == li[2]**2 :
        print 'YES'
    else:
        print 'NO'

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8


def is_right_triangle(a, b, c):
    return a ** 2 + b ** 2 == c ** 2


def main():
    input_count = int(raw_input())
    for i in xrange(input_count):
        L = raw_input().split(" ")
        L = map(long, L)
        L.sort()
        print ("NO", "YES")[is_right_triangle(*L)]

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
import sys

t = raw_input()
for i in range(int(t)):
    x = [int(s) for s in 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:
from __future__ import absolute_import, print_function, unicode_literals
import sys

def judge(a, b, c):
    print('YES' if (a == b + c or b == c + a or c == a + b) else 'NO')

sys.stdin.readline()
for line in sys.stdin:
    judge(*(int(n) ** 2 for n in line.split()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for i in range(int(raw_input())):a=sorted([int(x)**2 for x in raw_input().split()]);print ["NO","YES"][a[0]+a[1]==a[2]]

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:
import sys
n = raw_input()
for line in sys.stdin:
    li = sorted([int(x) for x in line.split()],reverse=True)
    print "YES" if (li[0]**2 == li[1]**2 + li[2]**2) else "NO"

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = []
try:
    while True:
        data.append(raw_input())

except EOFError:
    pass

n = int(data[0])
if n <= 1000:
    for i in range(1, n+1):
        x, y, z = data[i].split()
        x, y, z = int(x), int(y), int(z)
        if x <= 1000 and y <= 1000 and z <= 1000:
            if (z * 0.8 == x and z * 0.6 == y
                or z * 0.8 == y and z * 0.6 == x
                or y * 0.8 == x and y * 0.6 == z
                or y * 0.8 == z and y * 0.6 == x
                or x * 0.8 == z and x * 0.6 == y
                or x * 0.8 == y and x * 0.6 == z):
                print "YES"
            else:
                print "NO"

Submission status: Accepted

Solution code:
import sys

count = int(raw_input())
#print count                                                                                                                                                                                                                                   
while 0 < count:
    count -=1
    #print count                                                                                                                                                                                                                               
    a = map(int,raw_input().split())
    #print a[0],a[1],a[2]                                                                                                                                                                                                                      

    if a[1]< a[2]:
        tmp = a[1]
        a[1] = a[2]
        a[2] = tmp

    if a[0] < a[1]:
        tmp = a[0]
        a[0] = a[1]
        a[1] = tmp

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

Submission status: Accepted

Solution code:

import sys
import re


def judge(a, b, c):
    if a ** 2 + b ** 2 == c ** 2:
        return "YES"
    else:
        return "NO"


#file = sys.argv[1]
#lis = open(file, "r").readlines()
lis = sys.stdin.readlines()
lis.pop(0)

for line in lis:
    edges = map((lambda x: int(x)), re.split(" +", line))
    edges.sort()
    r = judge(edges[0], edges[1], edges[2])
    print r

Submission status: Accepted

Solution code:
while True:
	try:
		list = [int(item) for item in raw_input().split()]
		list.sort()
		if list[0] ** 2 + list[1] ** 2 == list[2] ** 2 :
			print 'YES'
		else :
			print 'NO'
	except EOFError:
		break
	except IndexError:
		continue

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
for x in range(n) :
  edges = map(int, raw_input().split())
  a = min(edges); edges.remove(a)
  b = min(edges); edges.remove(b)
  c = edges[0]

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

Submission status: Accepted

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

if __name__ == '__main__':

	N = int(raw_input())

	for i in range(0,N):

		a, b, c = raw_input().split()
		triangle = [int(a),int(b),int(c)]
		triangle.sort()
		
		if(triangle[2]**2 == triangle[0]**2 + triangle[1]**2):
			print 'YES'
		else :
			print 'NO'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for i in range(input()):
    q,w,e=sorted(map(int,raw_input().split()))
    print "YES" if q**2+w**2==e**2 else "NO"

Submission status: Accepted

Solution code:
for i in range(input()):
    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:
#coding UTF-8

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Is it a Right Triangle?

import sys

N = 0
datas = []

for (i, line) in enumerate(sys.stdin):
	if i == 0:
		N = int(line)
	else:
		datas.append([int(line.split()[0]), int(line.split()[1]), int(line.split()[2])])

for data in datas:
	index = data.index(max(data))
	x = data[index] * data[index]
	y = 0
	for i in [0, 1, 2]:
		if index == i:
			continue
		else:
			y += data[i] * data[i]
	if x == y:
		print "YES"
	else:
		print "NO"

Submission status: Accepted

Solution code:
n = input()
for x in range(n):
        l = map(int,raw_input().split())
        lmax = max(l)
        l.remove(lmax)
        if l[0]**2 + l[1]**2 == lmax**2:
                print("YES")
        else:
                print("NO")

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

iiart = lambda x,y,z: "YES" if (z**2 == x**2+y**2) else "NO"

if __name__ == "__main__":
    for i in range(int(raw_input())):
        print "%s" % (iiart(*sorted([int(x) for x in raw_input().split()])))

Submission status: Accepted

Solution code:
for i in xrange(input()):
	i,j,k = sorted([int(i) for i in raw_input().split()])
	print "YES" if i**2 + j**2 == k**2 else "NO"

Submission status: Accepted

Solution code:
timel = int(raw_input())
for gomi in xrange(timel):
 a,b,c = map(lambda x: int(x)**2, raw_input().split())
 if a+b==c or b+c==a or c+a==b:
  print "YES"
 else:
  print "NO"

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys

for line in sys.stdin.readlines():
    List = map(int, line.strip().split())
    if len(List) == 1: continue
    List.sort()
    if(List[2]**2 == List[0]**2 + List[1]**2):
        print "YES"
    else:
        print "NO"

Submission status: Accepted

Solution code:
import math
n = int(raw_input())

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

Submission status: Accepted

Solution code:
N = int(raw_input())
for i in range(N):
  a,b,c = sorted(map(int, raw_input().split()))
  print (a**2 + b**2 == c**2 and 'YES') or 'NO'

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
for i in range(input()):

    ary = map(int,raw_input().split())
    c = max(ary)
    ary.remove(c)
    a,b = ary

    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 = 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:
for n in range(input()):
  a,b,c=sorted(map(int,raw_input().split()))
  print ["NO","YES"][c*c-a*a-b*b==0]

Submission status: Accepted

Solution code:
for n in range(input()):
  a,b,c=sorted(map(int,raw_input().split()))
  print ["NO","YES"][c*c==a*a+b*b]

Submission status: Accepted

Solution code:
m=["NO","YES"]
for n in range(input()):
  a,b,c=sorted(map(int,raw_input().split()))
  print m[c*c==a*a+b*b]

Submission status: Accepted

Solution code:
import sys

n = input()

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

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"

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in xrange(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:
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):
    a, b, c = sorted(map(int, input().strip().split()))
    print('YES' if a**2 + b**2 == c**2 else 'NO')

Submission status: Accepted

Solution code:

def tr(a,b,c):
	l = a*a
	m = b*b
	n = c*c
	if(l+m==n or m+n==l or l+n==m):
		print "YES"
	else:
		print "NO"
for i in range(int(raw_input())):
	(l,m,n) = map(int,raw_input().split())
	tr(l,m,n)

Submission status: Accepted

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

t = int(input())
for i in range(t):
    sides = input().split(' ')
    for i in range(3):
        sides[i] = int(sides[i])
    sides.sort()
    r = triangle(sides[0], sides[1], sides[2])
    if (r): 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(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:
x=int(input())
list=[]
for i in range(x):
    a,b,c=input().split()
    list.append((int(a),int(b),int(c)))
    a=int(a)
    b=int(b)
    c=int(c)
    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")

Submission status: Accepted

Solution code:
N=int(input())
i=0
while i<N:
    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')
    i+=1

Submission status: Accepted

Solution code:
N=int(input())

for i in range(1,N+1) :
    x,y,z = map(int,input().split())
    X=max(x,y,z)
    Y=min(x,y,z)
    Z=x+y+z-X-Y
    if X**2==Y**2+Z**2:
        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[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):
    a,b,c = map(int,input().split())
    L = [a,b,c]

    m = L.pop(L.index(max(L)))
    d = L[0] ** 2 + L[1] ** 2

    if m ** 2 ==d:  
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
a=int(input())

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