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(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:
def is_triangle(x, y, z):
    x, y, z = sorted([x, y, z])
    return x**2 + y**2 == z**2

num = int(input())
for i in range(num):
    x, y, z = map(int, input().split())
    triangle = is_triangle(x, y, z)
    if triangle:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
def to_i(e):
  return int(e)

n = int(raw_input().rstrip())

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

Submission status: Accepted

Solution code:
#1???????????????
num_data = int(input())


for i in range(num_data):
    input_line = input().split(" ")
    
    a = int(input_line[0])
    b = int(input_line[1])
    c = int(input_line[2])
    
    #?????????????????????????????????????????§
    if (pow(a,2) + pow(b,2) == pow(c,2) ) or (pow(a,2) + pow(c,2) == pow(b,2) ) or (pow(b,2) + pow(c,2) == pow(a,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()))
    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())
    if (a**2 + b**2 + c**2 - 2*(max(a,b,c)**2)) == 0:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline().strip())
for i in range(n):
    line = sys.stdin.readline()
    lengths = sorted(list(map(int, line.strip().split())))
    if lengths[0]**2 + lengths[1]**2 == lengths[2]**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()))
    if a[0]**2 == a[1]**2 + a[2]**2 or a[1]**2 == a[2]**2 + a[0]**2 or 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):
    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:
#coing:utf-8


def distance(a,b):

    dst = pow(a,2) + pow(b,2)

    return dst

def isTriangle(lines):

    idxList = [[0,1,2],[1,0,2],[2,0,1]]
    flag = False
    for i in idxList:
        if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
            flag = True

    return flag

if __name__ == '__main__':

    num = int(input())

    results = []

    for i in range(num):
        lines = [int(item) for item in input().split(" ")]
        results.append(isTriangle(lines))

    for r in results:
        if r:
            print("YES")
        else :
            print("NO")

Submission status: Accepted

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

for j in range(n):
    if data[j][0]**2 == data[j][1]**2 + data[j][2]**2:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

import sys
import os

N = int(input())
for i in range(N):
    lst = list(map(int, input().split()))
    mx = max(lst)
    lst.remove(mx)

    if mx * mx == lst[0] * lst[0] + lst[1] * lst[1]:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
def my_func(i):
	return i*i
raw_input()
while True:
	try:
		splited = map(int, raw_input().split())
		sort_num = sorted(splited)
		if my_func(sort_num[0])+my_func(sort_num[1]) == my_func(sort_num[2]):
			print 'YES'
		else:
			print 'NO'
	except EOFError:
		break

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

Submission status: Accepted

Solution code:
# coding:utf-8

def main():
    N = int(input().rstrip())

    for i in range(N):
        ls = list(map(int, input().split(' ')))
        ls.sort()

        if(ls[0]**2 + ls[1]**2 == ls[2]**2):
            print('YES')
        else:
            print('NO')
            
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = list()

for i in range(n):
        line = input().split(" ")
        a = float(line[0])
        b = float(line[1])
        c = float(line[2])
        if ((a**2 + b**2) == c**2) or ((b**2 + c**2) == a**2) or ((c**2 + a**2) == b**2):
            ans.append("YES")
        else:
            ans.append("NO")

for j in range(n):
        print(ans[j])

Submission status: Accepted

Solution code:
import sys
import math

for line in sys.stdin:
  a = line.split()
  if len(a) == 3:
    if (int(a[0])*int(a[0]) + int(a[1])*int(a[1])) == int(a[2])*int(a[2]) or (int(a[0])*int(a[0]) + int(a[2])*int(a[2])) == int(a[1])*int(a[1]) or (int(a[2])*int(a[2]) + int(a[1])*int(a[1])) == int(a[0])*int(a[0]):
    
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
import sys

for line in range(int(input())):
    str = input().split(" ")
    nums = sorted([int(str[2]), int(str[1]), int(str[0])])
    if nums[2]*nums[2] == nums[1]*nums[1] + nums[0]*nums[0]:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

for j in range(N):

    x = a[j][0] ** 2
    y = a[j][1] ** 2
    z = a[j][2] ** 2

    if x == y + z:
        print "YES"
    elif y == x + z:
        print "YES"
    elif z == x + y:
        print "YES"
    else:
        print "NO"

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    while True:
        try:
            num_list = [int(i) for i in input().split()]
            num_list = sorted(num_list)
            a,b,c = num_list[0],num_list[1],num_list[2]
            if (a**2 + b**2) == c**2:
                print("YES")
            else:
                print("NO")
        except EOFError:
            break
    return None

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline().rstrip())
for i in range(N):
    l1,l2,l3 = sorted(map(int, sys.stdin.readline().rstrip().split(' ')))
    print("YES" if (l1**2 + l2**2 == l3**2) else "NO")

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N):
    p = input()
    li = sorted([int(i) for i in p.split(" ")])
    if li[-1]**2 == li[-2]**2 + li[-3]**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

n = int(raw_input())

for i in range(0, n):
	inpt = map(int, raw_input().split())
	inpt.sort()
	
	print righttriangle(inpt[0], inpt[1], inpt[2])

Submission status: Accepted

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

noOfInputs = int(input())
for i in range(noOfInputs):
	numsInStr = input().split()
	nums = []
	for n in numsInStr:
		nums.append(int(n))

	largest = max(nums)	
	nums.remove(max(nums))
	#print(nums)

	if (largest**2 == sum([i**2 for i in nums])):
		print('YES')
	else:
		print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

def is_right(a, b, c):
    a2 = a*a
    b2 = b*b
    c2 = c*c

    return a2==b2+c2 or b2==c2+a2 or c2==a2+b2

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

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

        result = is_right(a, b, c)
        print("YES" if result else "NO")

if __name__ == "__main__": main()

Submission status: Accepted

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

	for _ in range(n):
		len_list = map(int, input().split())
		check_tri(len_list)

def check_tri(len_list):
	import itertools
	import math

	flag = False
	for tmp in list(itertools.permutations(len_list)):
		if (pow(tmp[0], 2) + pow(tmp[1], 2)) == pow(tmp[2], 2):
			flag = True
			break

	if flag == True:
		print('YES')
	else:
		print('NO')

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys;

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
for i in sys.stdin:
    try:
        sidelen = [int(j) for j in i.split(" ")]
        sidelen.sort(reverse=True)
        if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2):
            print("YES")
        else:
            print("NO")
    except:
        continue

Submission status: Accepted

Solution code:
import sys
for i in sys.stdin:
    try:
        sidelen = [int(j) for j in i.split(" ")]
        if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2 or sidelen[1]**2 == sidelen[0]**2 + sidelen[2]**2 or sidelen[2]**2 == sidelen[0]**2 + sidelen[1]**2):
            print("YES")
        else:
            print("NO")
    except:
        continue

Submission status: Accepted

Solution code:
a=int(input())
for i in range(a):
    x,y,z=[int(i) for i in input().split() ]
    if (x*x==z*z+y*y)or(y*y==z*z+x*x)or(z*z==x*x+y*y):
        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==a*a+c*c or c*c==b*b+a*a):
        print('YES')
    else:
        print('NO')

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

def check(a, b, c):

    a2 = a ** 2
    b2 = b ** 2
    c2 = c ** 2

    if (a2 + b2) == c2:
        return True
    else:
        return False


n = int(input())

for c in range(n):
    line = input()
    datas = map(int, line.split())
    li = list(datas) 
    a = li[0]
    b = li[1]
    c = li[2]

    if check(a, b, c) or check(b, c, a) or check(c, a, b):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    a = []
    for _ in range(N):
        a.append(list(map(int, input().split())))

    for x in range(N):
        a[x].sort(reverse = True)
        if a[x][0] ** 2 == a[x][1] ** 2 + a[x][2] ** 2:
            print("YES")
        else:
            print("NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
data = [sorted(map(int, input().split(' '))) for i in range(n)]

for d in data:
    if d[0]**2 + d[1]**2 == d[2]**2:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
# Aizu Problem 0003: Is it a Right Triangle?
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


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

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !

import sys
import math

r = sys.stdin.readlines()

n = [[int(i) for i in (j.split())] for j in r]

for i in range(1,n[0][0]+1):
    sq = []
    for a in n[i]:  #a is lengthes
        sq.append(a**2)
    if (sum(sq)-2*max(sq) == 0):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n = input()

for _ in range(int(n)):
  a, b, c = sorted(map(int, sys.stdin.readline().split()))
  if a * a + b*b == c* c:
    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:
n = int(input())
for i in range(n):
    a = list(map(int, input().split()))
    m = max(a)
    b = sum([i**2 for i in a if i != m])
    if (m**2 == b):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

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

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N):
	line = input()
	l = [None]*3
	l[0] = int(line.split()[0])
	l[1] = int(line.split()[1])
	l[2] = int(line.split()[2])
	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 _ in range(n):
    l = list(map(int,input().split()))
    idx = l.index(max(l))
    c = l[idx]
    a, b  = [x for i,x in enumerate(l) if i != idx] 
    if a**2 + b**2 == c**2:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
def tri(a,b,c):
	return a**2 == b**2 + c**2
for time in range(int(input())):
	x,y,z = [int(i) for i in input().split()]
	if tri(x,y,z) or tri(y,z,x) or tri(z,x,y):
		print("YES")
	else:
		print("NO")

Submission status: Accepted

Solution code:
n = int(raw_input())

while n > 0:
  d = map(int, raw_input().split())
  d.sort()
  a = d[0]
  b = d[1]
  c = d[2]

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

  n = n-1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():

    data_count = int(input())
    data = [list(map(int, input().split())) for i in range(data_count)]

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


main()

Submission status: Accepted

Solution code:
def isRightTriangle(lineList):
    if lineList[0]**2 + lineList[1]**2 == lineList[2]**2:
        return True
    else:
        return False
if __name__ == '__main__':
    n = (int)(input())
    for _ in range(0,n):
        tmp = list(map(int,input().split()))
        tmp.sort()
        print("YES" if isRightTriangle(tmp) else "NO")

Submission status: Accepted

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

lineNum = int(input())

for i in range(lineNum):
    line = input()
    tokens = list(map(int, line.strip().split()))

    tokens.sort()

    a, b, c = tokens[0], tokens[1], tokens[2]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys;
#from me.io import dup_file_stdin

#@dup_file_stdin
def solve():
    n=int(sys.stdin.readline())
    for i in range(n):
        x=[int(num) for num in sys.stdin.readline().split(' ')]
        x.sort();
        if(x[0]**2+x[1]**2==x[2]**2): print("YES")
        else :print("NO")
solve()

Submission status: Accepted

Solution code:
import sys
l = sys.stdin.readlines ()
del l[0] # Delete number represents the number of detasets.
for line in l:
    data = map (int, line.split (" "))
    data.sort(reverse=True)
    if data[0]**2 == data[1]**2 + data[2]**2:
        print ("YES")
    else: print ("NO")

Submission status: Accepted

Solution code:
# coding=utf-8
import math


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

Submission status: Accepted

Solution code:
# usr/bin/python
# coding: utf-8
################################################################################
# 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
#
################################################################################

if __name__ == "__main__":
    num = int(input())
    inputline = [""]*num
    for i in range(0,num):
        inputline[i] = input()
    for line in inputline:
        a = int(line.split(" ")[0])
        b = int(line.split(" ")[1])
        c = int(line.split(" ")[2])
        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:
def ifTriangle(a, b, c):
    if (a**2) + (b**2) == c**2: print("YES")
    else: print("NO")

n=int(input())
for i in range(n):
    lines=list(map(int, input().split()))
    lines.sort()
    ifTriangle(lines[0], lines[1], lines[2])

Submission status: Accepted

Solution code:

N = input()

a = []
for i in range(int(N)):
    s = input().split()
    ss = [int(s[0]), int(s[1]), int(s[2])]
    ss.sort()

    if ss[2]**2 == ss[0]**2 + ss[1]**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]**2 + l[1]**2 == l[2]**2: print("YES")
    else: print("NO")

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

Solution code:
def triangle(dataset):
    a, b, c = dataset
    if a*a + b*b == c*c:
        return 1
    return 0

N = int(input())
for _ in range(N):
    dataset = sorted(map(int, input().split()))
    flag = triangle(dataset)
    print(["NO", "YES"][flag])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
class triangle():
    def __init__(self,a,b,c):
        self.a = a
        self.b = b
        self.c = c

    def calc(self):
        a = int(self.a**2)
        b = int(self.b**2)
        c = int(self.c**2)

        if (a+b == c) or (b+c == a) or (a+c == b):
            return True
        else:
            return False

    def print(self):
        ans = self.calc()
        if ans:
            print("YES")
        else:
            print("NO")

def main():
    data = []
    array_size = int(input())

    for i in range(array_size):
        n = input().split()
        a = int(n[0])
        b = int(n[1])
        c = int(n[2])

        data.append(triangle(a,b,c))

    for array in data:
        array.print()

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
count=int(raw_input())

for i in range(0,count):
    a,b,c=map(int,raw_input().split())
    if pow(a,2)+pow(b,2)==pow(c,2):
        print 'YES'
    elif pow(a,2)+pow(c,2)==pow(b,2):
        print 'YES'
    elif pow(b,2)+pow(c,2)==pow(a,2):
        print 'YES'
    else:
        print 'NO'

Submission status: Accepted

Solution code:
count=int(raw_input())
ans =[]
for i in range(0,count):
    a,b,c=map(int,raw_input().split())
    if pow(a,2)+pow(b,2)==pow(c,2):
        ans.append("YES")
    elif pow(a,2)+pow(c,2)==pow(b,2):
        ans.append("YES")
    elif pow(b,2)+pow(c,2)==pow(a,2):
        ans.append("YES")
    else:
        ans.append("NO")

for i in range(0,count):
    print ans[i]

Submission status: Accepted

Solution code:
N=int(input())
for i in range(N):
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2
    if A+B==C:
        print('YES')
    elif A+C==B:
        print('YES')
    elif B+C==A:
        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())
    A=a**2
    B=b**2
    C=c**2
    if A+B==C:print('YES')
    elif A+C==B:print('YES')
    elif B+C==A:print('YES')
    else:print('NO')

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
count=int(raw_input())
ans =[]
for i in range(0,count):
    a,b,c=map(int,raw_input().split())
    if pow(a,2)+pow(b,2)==pow(c,2):
        ans.append("YES")
    elif pow(a,2)+pow(c,2)==pow(b,2):
        ans.append("YES")
    elif pow(b,2)+pow(c,2)==pow(a,2):
        ans.append("YES")
    else:
        ans.append("NO")

for i in range(0,count):
    print ans[i]

Submission status: Accepted

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