Go: package main

import (
  "fmt"
)


func main() {
  var a int
  var b int
  var c int
  var n int
  fmt.Scan(&n)
  for _, err := fmt.Scan(&a, &b, &c); err == nil; _, err = fmt.Scan(&a, &b, &c) {
    if a*a == b*b+c*c {
      fmt.Println("YES")
    } else if b*b == c*c+a*a {
      fmt.Println("YES")
    } else if c*c == a*a+b*b {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

C++: // This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <stdio.h>

int main()
{
int n;
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
int a;
int b;
int c;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    
if(a*a+b*b==c*c){
    printf("YES\n");
}
else if(b*b+c*c==a*a){
    printf("YES\n");
}
else if(c*c+a*a==b*b){
    printf("YES\n");
}
else {
    printf("NO\n");
}
        
}
}
// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://msdn.microsoft.com/library/3bstk3k5.aspx
//   http://www.cplusplus.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   http://www.boost.org/doc/

C++: #include <stdio.h>
#include <stdbool.h>

int main(void)
{
    int n, a[3];
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        bool flag = false;
        scanf("%d %d %d", &a[0], &a[1], &a[2]);
        for (int j = 0; j < 3; ++j) {
            if (a[j] * a[j] == a[(j + 1) % 3] * a[(j + 1) % 3] + a[(j + 2) % 3] * a[(j + 2) % 3]) {
                flag = true;
            }
        }
        if (flag) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
int main(){
	vector<int> a(3);
	cin >> a[0];
	while(cin>>a[0]>>a[1]>>a[2]){
		sort(a.begin(),a.end());
		if(a[2]*a[2]==a[0]*a[0] + a[1]*a[1]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
}

C++: #include<iostream>
#include<cstdio>

using namespace std;

void bigger(int *x, int *y);

int main(void){
	int data;
	int n1, n2, n3;
	cin >> data;
	for(int i = 0; i < data; i++){
		scanf("%d %d %d", &n1, &n2, &n3);
		bigger(&n1, &n2);
		bigger(&n1, &n3);
		
		if(n1* n1 == n2*n2 + n3*n3)
		cout << "YES" << endl;
		else
		cout << "NO" << endl;
		
	}
	return 0;
}

void bigger(int *x, int *y){
	if(*y > *x){
		int type = *x;
		*x = *y;
		*y = type;
	}
}

C++: #include <deque>
#include <iostream>
#include <algorithm>

int main()
{
        using namespace std;
        deque<int> edge;
        int iedge[3];
        int j;
        int a,b,c;

        cin >> j;

        for(int l=0;l<j;l++){
                for(int i=0;i<3;i++){
                        cin >> iedge[i];
                edge.push_back(iedge[i]);
                }

                sort(edge.begin(),edge.end());
                a = edge[0];
                b = edge[1];
                c = edge[2];
                if(c*c == (a*a+b*b))cout << "YES\n";
                else cout << "NO\n";

                edge.clear();

        }

        return 0;
}

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

int main() {
	int n;

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

		cin >> a >> b >> c;
		if (a>b && a>c) {
			if (b*b + c*c == a*a) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
		else if (b>a && b>c) {
			if (a*a + c*c == b*b) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
		else {
			if (a*a + b*b == c*c) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int a,b,c,i,n;
    cin>>i;
    for(n=0;n<i;n++){
        if(a*a==b*b+c*c){
            cout<<"YES"<<endl;
        }else if(b*b==a*a+c*c){
            cout<<"YES"<<endl;
        }else if(c*c==b*b+a*a){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
       return 0;
}

C++: #include <stdio.h>

int main(void) {
	int a, b, c, i ,j;
	scanf("%d", &j);
	for(i= 1; i <= j ;i++){
		scanf("%d%d%d", &a, &b, &c);
		if (a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a){
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	
	return 0;
}

C++: #include<stdio.h>

int main(void){
	int kosu,a[5]={0},temp,right,temp2,left;

	scanf("%d",&kosu);

	for(temp=0;temp<kosu;temp++){
		scanf("%d %d %d",&a[0],&a[1],&a[2]);
		
		for(int i=0;i<3;i++){
			for(int j=0;j<3;j++){
				if(a[j]<a[j+1]){
					temp2=a[j];
					a[j]=a[j+1];
					a[j+1]=temp2;
				}
			}
		}
		right=(a[2])*(a[2])+(a[1])*(a[1]);
		
		left=(a[0])*(a[0]);
		
		if(left==right){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: # include <iostream>
# include <algorithm>
# include <cmath>

int n;
int edge[3];

int main() {
	std::cin >> n;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < 3; ++j)
			std::cin >> edge[j];
		std::sort(edge, edge + 3);
		if (pow(edge[2],2)==pow(edge[1],2)+pow(edge[0],2))
			std::cout << "YES" << std::endl;
		else
			std::cout << "NO" << std::endl;
	}
		return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<stdio.h>

int main(){
  int N = 0 ,i,j,k,tmp = 0;
  int tri[3] = {0,0,0};
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d %d %d",&tri[0],&tri[1],&tri[2]);
    for(j = 0;j <= 2;j++){
      for(k = j + 1;k <= 2;k++){
	tmp = tri[j];
	tri[j] = tri[k];
	tri[k] = tmp;
      }
    }
    if(tri[0] * tri[0] == tri[1] * tri[1] + tri[2] * tri[2]){
      printf("YES\n");
    }
    else{
      printf("NO\n");
    }
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>

using namespace std;

int main(){
	int n, a[3];

	cin >> n;
	while (n-- > 0) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		cout << (a[0] * a[0] + a[1] * a[1] == a[2] * a[2] ? "YES" : "NO") << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main(){
    int a[3];
    int N; cin >> N;
    while(N--){
        cin >> a[0] >> a[1] >> a[2];
        sort(a, a+3);
        if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}

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

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()

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

    REP(i, n) {
        vector<int> v(3);
        REP(j, 3) {
            cin >> v[i];
        }
        sort(ALL(v));
        if (pow(v[0],2)+pow(v[1],2)==pow(v[2],2)) cout << "YES" << endl;
        else cout << "NO" << endl; 
    }
    return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;

int main(){
	int n;
	int a[3];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d %d %d",&a[0],&a[1],&a[2]);
	sort(a,a+3);
	if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]) printf("YES\n");
	else printf("NO\n");
	}
	return 0;
}

C++: #include <iostream>

bool isRightTriangle(int a, int b, int c);

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

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