Chef loves triangles. But the chef is poor at maths. Given three random lengths Chef wants to find if the three sides form a right-angled triangle or not. Can you help Chef in this endeavour?
-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, three Integers $A,B and C$
-----Output:-----
For each test case, output in a single line "YES" if it is possible to form a triangle using the given numbers or "NO" if it is not possible to form a triangle.
-----Constraints-----
- $1 \leq T \leq 1000000$
- $0 \leq A,B,C \leq 100$
-----Sample Input:-----
2
3 4 5
1 3 4
-----Sample Output:-----
YES
NO
-----EXPLANATION:-----
3,4,5 forms a right-angled triangle. 1, 3 and 4 does not form a right-angled triangle.
#!/usr/bin/env python3
# coding: utf-8
#Last Modified: 23/Feb/20 12:23:37 PM


import sys


def main():
    def checkValidity(a, b, c):   
        if (a + b <= c) or (a + c <= b) or (b + c <= a) : 
            return False
        else: 
            return True      
    def checkrt(a, b, c):
        if a**2 + b**2 == c**2 or a**2+c**2==b**2 or b**2+c**2==a**2:
            return True
        return False
    for tc in range(int(input())):
        a, b, c=get_ints()
        if checkValidity(a, b, c):
            if checkrt(a, b, c):
                print('YES')
            else:
                print('NO')
        else:
            print('NO')


get_array = lambda: list(map(int, sys.stdin.readline().split()))


get_ints = lambda: list(map(int, sys.stdin.readline().split()))


input = lambda: sys.stdin.readline().strip()


main()

#!/usr/bin/env python3
# coding: utf-8
#Last Modified: 23/Feb/20 12:23:37 PM


import sys


def main():
    def checkValidity(a, b, c):   
        if (a + b <= c) or (a + c <= b) or (b + c <= a) : 
            return False
        else: 
            return True      
    def checkrt(a, b, c):
        if a**2 + b**2 == c**2 or a**2+c**2==b**2 or b**2+c**2==a**2:
            return True
        return False
    for tc in range(int(input())):
        a, b, c=get_ints()
        if checkValidity(a, b, c):
            if checkrt(a, b, c):
                print('YES')
            else:
                print('NO')
        else:
            print('NO')


get_array = lambda: list(map(int, sys.stdin.readline().split()))


get_ints = lambda: list(map(int, sys.stdin.readline().split()))


input = lambda: sys.stdin.readline().strip()


main()
