Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	nQueries := nextInt()
	for i := 0; i < nQueries; i++ {
		lengths := []int{nextInt(), nextInt(), nextInt()}
		sort.Slice(lengths, func(i, j int) bool { return lengths[i] > lengths[j] })
		if math.Pow(float64(lengths[0]), 2) == math.Pow(float64(lengths[1]), 2)+math.Pow(float64(lengths[2]), 2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include<cmath>
#include<cctype>
#include<iomanip>
#include<fstream>
#include<sstream>

using namespace std;

#define fi first
#define se second
#define pb push_back
#define pf push_front
#define mp make_pair
#define si size()
#define fr front()
#define ba back()
#define tp top()

typedef long long int ll;
typedef long double ld;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef pair<pii,pii> ppp;
typedef pair<double,double> pdd;
typedef pair<double,pdd> pddd;

#define CASE() for(int Case=1;Case<=Tc;Case++)
#define iofast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
const int adj[8][2]={{-1,0},{0,-1},{1,0},{0,1},{-1,-1},{-1,1},{1,1},{1,-1}};
const int INF=1e9;
const ll MOD=1e9+7;
const double EPS=1e-9;
const int SIZE=64;

int main (){
	
	int N;
	int a, b, c;
	scanf("%d", &N);
	while(N--){
		scanf("%d %d %d", &a, &b, &c);
		if(((a*a)+(b*b)==(c*c)) || ((c*c)+(b*b)==(a*a)) || ((a*a)+(c*c)==(b*b))) printf("YES\n");
		else printf("NO\n");
	}
	
	return 0;
}

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

int main(){
  int n, a, b, c;

  cin >> n;

  for (int i=0; i<n; i++){
    cin >> a >> b >> c;
    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 == a*a+b*b){
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin>>n;
    while (n--)
        {
            int a,b,c;
            if (a*a + b*b =c*c)
            
                cout<<"YES";
                else 
                    cout<<"NO";
            
        }
    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,i,w,a,s,d,x,j,z[1000];
	while(scanf("%d",&n)!=EOF){
		for(i=0;i<n;i++){
			scanf("%d %d %d",&a,&s,&d);
			if(a>s&&d<a){
				w=(d*d)+(s*s);
				x=a*a;
					if(w==x){
						z[i]=1;
					}
					else{
						z[i]=0;
					}	
			}	
			if(a<d&&d>s){
				w=(a*a)+(s*s);
				x=d*d;
					if(w==x){
						z[i]=1;
					}
					else{
						z[i]=0;
					}				
			}
			if(a<s&&s>d){
				w=(d*d)+(s*s);
				x=s*s;
					if(w==x){
						z[i]=1;
					}
					else{
						z[i]=0;
					}				
			}
			if(a==s&&s==d){
				z[i]=0;
			}	
		for(i=0;i<n;i++){
			if(z[i]==1){
				printf("YES\n");
			}	
			if(z[i]==0){
				printf("NO\n");
			}
		}	
		}
	}
	return 0;
}

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

bool tri(int x,int y,int z){
	return (x*x+y*y==z*z)?1:0;
}

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

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

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

C++: #include <iostream>
 
using namespace std;
 
int main(){
  int num,tmp;
 
  cin >> num;

  int a[num][3];


  for(int i=0; i<num; ++i)
    cin >> a[i][0] >> a[i][1] >> a[i][2];


  for(int i=0; i<num; ++i){
    
    for(int j=0; j<3; ++j){
      for(int k=j+1; k<3; ++k){
	if(a[i][j] < a[i][k]){
	  tmp = a[i][j];
	  a[i][j] = a[i][k];
	  a[i][k] = tmp;
	}
      }
    }
    
    if(a[i][0]*a[i][0] == a[i][1]*a[i][1] + a[i][2]*a[i][2]){
      cout << "YES\n";
    }else{
      cout << "NO\n";
    }
  }  

}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    while (n!=0){
        int a , b , c;
        cin >> a >> b >> c;
        if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b) cout << "YES" << endl;
        else cout << "NO" << endl;
        --n;
    }
}

C++: #include <stdio.h>

using namespace std;

int main(){
    int N;
    scanf("%d",&N);
    int a,b,c;
    for(int i = 0; i < N; ++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");
            continue;
        }
        printf("NO\n");
    }
    return 0;
}

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

int main() {
	int i, a[3];
	cin >> i;
	for (int j = 0; i > j; j++) {
		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;
	}
	return 0;
}

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

int main(){

	int n;
	int sd[3];
	int max,m=-1;
	bool isRect=false;
	bool isTri=true;

	cin>>n;

	for(int i=0;i<n;++i){
		cin>>sd[0]>>sd[1]>>sd[2];
		//長辺の判定
		max=0;
		for(int i=0;i<3;++i){
			if(sd[i]==0){isTri=false;}
			if(sd[i]>max){m=i;max=sd[i];}
		}

		//直角三角形の判定
		if(isTri){
			switch(m){
			case 0:
				if(sd[0]*sd[0] == (sd[1]*sd[1] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 1:
				if(sd[1]*sd[1] == (sd[0]*sd[0] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 2:
				if(sd[2]*sd[2] == (sd[1]*sd[1] + sd[0]*sd[0])){isRect=true;}else{isRect=false;}
				break;
			}
		}

		if(isRect){cout<<"YES\n";}else{cout<<"NO\n";}

	}
}

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

using namespace std;

int main(void){
  int data1[1000],data2[1000],data3[1000],data4[1000];
  int g,i;
  cin >> g;
  for(i=0;i<g;i++){
    cin >> data1[i] >> data2[i] >> data3[i];
  }
  int m,j;
  i=0;
  for(i=0;i<g;i++){
    for(j=0;j<3;j++){
      if(data1[i] < data2[i]){ m = data2[i]; data2[i] = data1[i]; data1[i] = m;  }
      if(data2[i] < data3[i]){ m = data3[i]; data3[i] = data2[i]; data2[i] = m;  }
    }
    if(pow(data1[i],2) == (pow(data2[i],2)+pow(data3[i],2))) cout << "YES" <<endl;
    else cout << "NO" << endl;
  }

}

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

int main(){
  int a,b,c;
  while(scanf("%d %d %d",&a,&b,&c)!=EOF){
  a*=a;
  b*=b;
  c*=c;
  if(a==(b+c)||b==(a+c)||c==(a+b))cout << "YES" <<endl;
  else cout << "NO" <<endl;
  }
  return 0;
}

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

int main()
{
	int nNum=0;
	cin>>nNum;
	int nIn[3]={0};
	while(nNum--)
	{
		cin>>nIn[0]>>nIn[1]>>nIn[2];
		int nMax=max(max(nIn[0],nIn[1]),nIn[2]);
		if(nMax*nMax*2==nIn[0]*nIn[0]+nIn[1]*nIn[2]+nIn[2]*nIn[2])
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}