Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	n, _ := strconv.Atoi(strScan())
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		scanner.Scan()
		strArr := strings.Fields(scanner.Text())
		castNumArr := StringToInt(strArr)
		fmt.Println(checkTriangle(castNumArr))
	}
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}

func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

C++: #include<stdio.h>
#include<iostream>
#include<algorithm>

using namespace std;


int main()
{
    long long int arr[10000],a,b,c,n,cas,i;
    scanf("%lld",&cas);
    for(i=0;i<cas;i++){
    scanf("%lld%lld%lld",&arr[0],&arr[1],&arr[2]);

    sort(arr,arr+3);

    a = arr[0];
    b=arr[1];
    c =arr[2];

        if(a==b&&b==c)
            printf("NO\n");

        else if(a*a+b*b>=c*c)
            printf("YES\n");

        else
            printf("NO\n");
    }
    return 0;

}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#include <utility>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)

int main()
{
	int a[4],n;
	cin >> n;
	REP(i, n)
	{
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[2] >= a[0] + a[1]) cout << "NO" << endl;
		else if (a[2] * a[2] == a[0] * a[0] + a[1] * a[1])cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int check(int a, int b, int c);

int main(){
	int N = 0;
	int A, B, C;
	int i, j, k;
	int work;
	cin >> N;
	for(i = 0; i < N; i++){
		cin >> A >> B >> C;

		if(check(A, B, C)){
				cout << "YES\n";				
		}
		
		else{
			cout << "NO\n";
		}
    }
    return 0;
}

int check(int a, int b, int c){
    if( (a * a + b * b) == c * c || (b * b + c * c) == a * a || (b * b + c * c) == a * a ){
        return 1;
    }
    
    else{
        return 0;
    }
	
}

C++: #include <iostream>
using namespace std;

int main(){
	int n;
	cin >>n;

	int a[n], b[n], c[n];

	for(int i=0; i<n; i++){
		cin >> a[i] >> b[i] >> c[i];
	}

	for(int i=0; i<n; i++){
		if(a[i]*a[i] == b[i]*b[i] + c[i]*c[i]){
			cout << "YES" << endl;
			continue;
		}
		if(b[i]*b[i] == a[i]*a[i] + c[i]*c[i]){
			cout << "YES" << endl;
			continue;
		}
		if(c[i]*c[i] == b[i]*b[i] + a[i]*a[i]){
			cout << "YES" << endl;
			continue;
		}
		cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

int main(){
	vector<string> results;
	int N = 0;
	cin >> N;
	for(int i = 0; i < N; i++){
		array<int, 3> triangle_vertex;
		for(int j = 0; j < 3; j++){
			cin >> triangle_vertex[j];
		}
		sort(begin(triangle_vertex), end(triangle_vertex));
		if(pow(triangle_vertex[0], 2) + pow(triangle_vertex[1], 2) == pow(triangle_vertex[2], 2)){
			results.push_back("YES");
		}
		else{
			results.push_back("NO");
		}
	}
	for(const auto& result : results){
		cout << result << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdbool.h>
void Judgetriangle(int a, int b, int c);
void judge(int a, int b, int c);
int a, b, c;
bool flag = false;
int main(void)
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i)
        {
            flag = false;
            scanf("%d %d %d", &a, &b, &c);
            Judgetriangle(a, b, c);
        }
    return 0;
}

void Judgetriangle(int a, int b, int c)
{
    judge (a, b, c);
    judge (a, c, b);
    judge (b, c, a);
    if (flag == true) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

void judge(int a, int b, int c)
{
    if (a*a + b*b == c*c) {
        flag = true;
    }
}

C++: #include <iostream>
using namespace std;

int main()
{
    int n;
    int a,b,c;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a>>b>>c;
        if(a>=b&&a>=c)
        {
            if(a*a==b*b+c*c)
                cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;
        }
        if(b>a&&b>c)
        {
            if(b*b==a*a+c*c)
                cout<<"YES"<<endl;
            else
                cout<<"NO"<<endl;
        }
        if(c>a&&c>b)
        {
            if(c*c==b*b+a*a)
                cout<<"YES"<<endl;
            else
                cout<<"NO"<<endl;
        }


    }
    return 0;
}

C++: #include<iostream>

using namespace std;

int main() {
	int n;
	int a,b,c;
	cin >> n;
	for(int i=0;i<n;i++){
		std::string p = "NO";
		cin >> a >> b >> c;
		if (a>b && a>c && a*a==b*b+c*c){p = "YES";}
		if (b>a && b>c && b*b==a*a+c*c){p = "YES";}
		if (c>a && c>b && c*c==a*a+b*b){p = "YES";}
		cout << p << endl;
	}


	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;

int main(){
    int n;
    cin >>n;
    REP(i, n){
        int a, b, c;
        cin >>a >>b >>c;
        bool ans = false;

        if(a * a + b * b == c * c) ans = true;
        if(a * a + c * c == b * b) ans = true;
        if(b * b + c * c == a * a) ans = true;

        if(ans) cout <<"YES" <<endl;
        else cout <<"NO" <<endl;
    }

    return 0;
}

C++: #include<stdio.h>
 
int main() {
    int N;
    int i;
    int a, b, c;
 
    scanf("%d\n", &N);
 
    for(i = 0; i < N; i++) {
        scanf("%d %d %d", &a, &b, &c);
        if (a > b && a > c)
            if (a*a == b*b + c*c)
                printf("YES\n");
            else
                printf("NO\n");
        else if(b > a && b > c)
            if(b*b == a*a + c*c)
                printf("YES\n");
            else
                printf("NO\n");
        else
            if(c*c == a*a + b*b)
                printf("YES\n");
            else
                printf("NO\n");
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()

typedef long long LL;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> Array;
typedef vector<int> LArray;

void readAll(Array& vec, int n) { for (int i = 0; i < n; i++) cin >> vec[i]; }

int m, n;


int main(void)
{
	while(cin >> n && n)
	{
		for (int i = 0; i < n; i++)
		{
			Array arr(3);
			readAll(arr, n);
			sort(ALL(arr));
			cout << (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1] ? "YES" : "NO") << endl;
		}
		return 0;
	}
	return 0;
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

bool isRightTriangle(int a, int b, int c)
{
	return (a * a == b * b + c * c);
}

int main()
{
	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++){
		vector<int> triangle;
		for (int j = 0; j < 3; j++){
			int edge;
			scanf("%d", &edge);
			triangle.push_back(edge);
		}
		sort(triangle.begin(), triangle.end());
		puts(isRightTriangle(triangle[2], triangle[1], triangle[0]) ? "YES" : "NO");
	}
	return (0);
}