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: Wrong Answer

Solution code:
count = int(raw_input())

for i in range(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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
import sys

a = ""
for input in sys.stdin:
    a += input
l = a.split()
for i in range(1,len(l),3):
    if((int(l[i]) * int(l[i]) + int(l[i+1]) * int(l[i+1])) == (int(l[i+2]) * int(l[i+2]))):
        print "YES"
    else:
        print "NO"

Submission status: Wrong Answer

Solution code:
for _ in[0]*int(input()):
 a,b,c=map(int,sorted(input().split()))
 print(['No','Yes'][a*a+b*b==c*c])

Submission status: Wrong Answer

Solution code:
for _ in[0]*int(input()):
 a,b,c=map(int,sorted(input().split()))
 print(['NO','YES'][a*a+b*b==c*c])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

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

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: Wrong Answer

Solution code:
d=input()
for a in range(int(d)):
    a,b,c=map(int,input().split())
    if(max(a,b,c)*2>=a+b+c):
        print(False)
    else:
        print(True)

Submission status: Wrong Answer

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
    else:
        return False

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

Submission status: Wrong Answer

Solution code:
import sys
a = []
for line in sys.stdin:
    a.append(line)
for i in a:
    sum = i[0] + i[1]
    print(len(str(sum)))

Submission status: Wrong Answer

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: Wrong Answer

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

main()

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
import sys
import math

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

Submission status: Wrong Answer

Solution code:
a=[]
n=input()
p=0
while p!=n:
    t=map(int,raw_input().split())
    if max(t)**2==sum(map(lambda x:x**2,t))/2:
        a.append("YES")
    else:
        a.append("NO")
    p+=1   
for i in a:
    print i

Submission status: Wrong Answer

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
	print "NO"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def is_right_triangle(L):
    L.sort()
    return L[0] ** 2 + L[1] ** 2 == L[2] ** 2


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def is_right_triangle(L):
    L.sort()
    return L[0] ** 2 + L[1] ** 2 == L[2] ** 2


def main():
    input_count = int(raw_input())
    inputs = []
    for i in xrange(input_count):
        L = raw_input().split(" ")
        L = map(int, L)
        inputs.append(L)

    for L in inputs:
        print ("N0", "YES")[is_right_triangle(L)]


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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


def is_right_triangle(L):
    L.sort()
    return L[0] ** 2 + L[1] ** 2 == L[2] ** 2


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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def is_right_triangle(L):
    L.sort()
    return L[0] ** 2 + L[1] ** 2 == L[2] ** 2


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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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


def is_right_triangle(L):
    L.sort()
    return L[0] ** 2 + L[1] ** 2 == L[2] ** 2


def main():
    input_count = int(raw_input())
    inputs = []
    for i in xrange(input_count):
        L = raw_input().split(" ")
        L = map(long, L)
        inputs.append(L)

    for L in inputs:
        print ("N0", "YES")[is_right_triangle(L)]

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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 ("N0", "YES")[is_right_triangle(*L)]

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
data = """\
3
4 3 5
4 3 6
8 8 8
"""

m = data.split("\n")
print m
n = int(m[0])
for i in range(1, n+1):
    x, y, z = m[i].split()
    x, y, z = int(x), int(y), int(z)
    print x, y, z
    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: Wrong Answer

Solution code:
data = """\
3
4 3 5
4 3 6
8 8 8
"""

m = data.split("\n")
n = int(m[0])
for i in range(1, n+1):
    x, y, z = m[i].split()
    x, y, z = int(x), int(y), int(z)
    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: Wrong Answer

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

except EOFError:
    pass

print data
n = int(data[0])
for i in range(1, n+1):
    x, y, z = data[i].split()
    x, y, z = int(x), int(y), int(z)
    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: Wrong Answer

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

except EOFError:
    pass

print data
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: Wrong Answer

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: Wrong Answer

Solution code:
for i in xrange(int(raw_input())):
        print "YES" if len(set(map(int, raw_input().split()))) == 1 else "NO"

Submission status: Wrong Answer

Solution code:
for i in range(int(raw_input())):
    if len(set(map(int, raw_input().split()))) == 1:
        print "YES"
    else:
        print "NO"

Submission status: Wrong Answer

Solution code:
import sys

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

Submission status: Wrong Answer

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]:
		print 'YES'
	else:
		print'NO'

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

t = int(input())
for i in range(t):
    a, b, c = input().split(' ')
    a = int(a)
    b = int(b)
    c = int(c)
    r = triangle(a, b, c)
    if (r): print("YES")
    else: print("NO")

Submission status: Time Limit Exceeded

Solution code:
while True:
    try:
        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"
    except:
        continue

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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):
    x, y, z =map(int, input().split())
    if x*x + y*y == z*z or y*y + z*z == x*x or x*x + z*z == y*y :
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = raw_input()
while 1:
	try :
		a = map(int,raw_input().split())
		a.sort()
		a.reverse()
#		print a
		if a[0]**2 == a[1]**2 + a[2]**2:
			print "YES"
		else : 
			print "NO"
	except EOFError:
		break

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())#ｎはデータセットの数
for i in range(n):#ｎ回繰り返す
  edge=input().split()#入力
  edge=[int(j) for j in edge]#入力
  edge.sort()#ここでedge[2]が最大になる
  if(edge[0]**2+edge[1]**2==edge[2]**2):#直角三角形かどうか
    print("YES")
  else:#そうでないなら
    print("NO")

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

import sys


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

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

Submission status: Accepted

Solution code:
import math
import itertools

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

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

    else:
        print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

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


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



if __name__ == "__main__":
	check()
	# print check_right_triangle(4, 3, 5)
	# print check_right_triangle(4, 3, 6)
	# print check_right_triangle(8, 8, 8)

Submission status: Accepted

Solution code:
import sys

raw_input()

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def right_triangle(edge):
    # a < b < c
    return (edge[0] ** 2 + edge[1] ** 2 == edge[2] ** 2)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin/python3

a=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

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

Submission status: Accepted

Solution code:
N = int(raw_input())

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

Submission status: Accepted

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

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:
n=int(input())
for i in range(n):
        s=input().split(" ")
        s=[int(j) for j in s]
        s.sort()
        
        if(s[0]**2+s[1]**2==s[2]**2):
            print("YES")

        else:
            print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:UTF-8

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