Go: package main
import (
    "fmt"
    "os"
    "bufio"
    "strconv"
    "sort"
)
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
func main(){
    sc.Split(bufio.ScanWords)
    defer out.Flush()
    n := nextInt()
    for i:=0; i<n; i++{
        data := nextInts(3)
        sort.Ints(data)
        if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
            fmt.Fprintln(out, "YES")
        }else{
            fmt.Fprintln(out, "NO")
        }
    }
}
 
func next() string{
    sc.Scan()
    return sc.Text()
}
 
func nextInt() int{
    a, _ := strconv.Atoi(next())
    return a
}
 
func nextInts(n int) []int{
    a := make([]int, n)
    for i:=0; i<n; i++{
        a[i] = nextInt()
    }
    return a
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

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

    rep(i, n)
    {
        vector<int> v(3);

        rep(i, 3) cin >> v[i];

        sort(ALL(v));

        if (v[2] * v[2] == v[1] * v[1] + v[0] * v[0])
        {
            OP("YES")
        }
        else
        {
            OP("NO")
        }
    }

    return 0;
}

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


#ifndef DEBUG 
#define fprintf (void)
#endif 

int main(void){
	
	long int rec,i,j,t;
	int count=0;
	long int n[3]={0,0,0};
	
	scanf("%ld",&t);
	
	for(i=0;i<t;i++){
		for(j=0;j<3;j++){
			scanf("%ld",&rec);
			if(rec==0){
				count=1;
			}
			if(rec>n[0]){
				n[2]=n[1];
				n[1]=n[0];	
				n[0]=rec;
			}else if(rec>n[1]){
				n[2]=n[1];
				n[1]=rec;
			}else if(rec>n[2]){
				n[2]=rec;
			}
		}
		if(count==1){
			fprintf(stdout,"invalid");
			printf("NO\n");
		}else if(n[0]*n[0]==n[1]*n[1]+n[2]*n[2]){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int  a, j, b, cnt, i, n, A = 0, B = 0, c;
	while (scanf("%d %d %d", &a, &b, &c) != EOF) {
		if (a == b && a == c) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
}

C++: #include <bits/stdc++.h>

using namespace std;


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

#define PB(a) push_back(a)
#define MOD 1000000007

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;cin>>n;
  for(int j=0;j<n;j++){
      std::vector<int> v(3);
      for(int i=0;i<3;i++) cin>>v[i];
      sort(v.begin(),v.end());
      if(v[0]*v[0]+v[1]*v[1]==v[2]*v[2]) cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include<stdio.h>


void swap(int *a, int *b){
	int w = *a;
	*a = *b;
	*b = w;
}


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

	int x, y, z, w;
	for(int i = 0; i < num; i++){
		scanf("%d %d %d", &x, &y, &z);
		if(x > z){
			swap(&x, &z);
		}
		if(y > z){
			swap(&y, &z);
		}
		if(x*x + y*y == z*z){
			printf("YES\n");
		}else{
			printf("NO\n");
		}

	}

	return 0;
}

C++: #include<stdio.h>
#include<ctype.h>
#include<time.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
using namespace std;
int main()
{
	int ar[3],t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d %d %d",&ar[0],&ar[1],&ar[2]);
		sort(ar,ar+3);
		if(ar[2] * ar[2] == ((ar[0] * ar[0]) + ar[1] * ar[1])) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

C++: #include <stdio.h>

int main ()
{
    int n=0,i=0,a,b,c;
    scanf("%d",&n);
    if(n<=1000)
    {
    while(n--)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a>1000 || a<1 || b>1000 || c>1000 || a<1 || b<1 || c<1)
            break;

          if(n==0){
            if(c*c == (a*a + b*b))
            printf("YES");
           else
            printf("NO");
        }
           else{
            if(c*c == (a*a + b*b))
            printf("YES\n");
           else
            printf("NO\n");
        }
    }
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

void swap(int *x, int *y) {
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}

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

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

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

  return 0;
}

C++: #include <iostream>
//#include <cstdio>
//#include <cmath>
using namespace std;
 
//0003
int main(){
	int n;
	int a, b, c, a2, b2, c2;
	cin >> n;
	while(--n){
		cin >> a >> b >> c;
		a2 = a^2;
		b2 = b^2;
		c2 = c^2;

		if(a==b==c){
			cout << "NO" << endl;
			break;
		}
		if(a2==b2+c2 || b2==a2+c2 || c2==a2+b2){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,P> pip;
const int inf=(1<<31)-1;

int n;

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

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

using namespace std;

int main(){
  int n; cin>>n;
  while(n --> 0){
    int a[3]; 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>
#define NMAX (1000)
using namespace std;
int main(void){
    
    int N = 0;
    int a=0;
    int b=0;
    int c=0;

    //N??°?????\???
    scanf("%d",&N);
    
    //N?????°???????????????a,b,c???????????????
    for(int Ncount = 0; Ncount < N; Ncount++){
        scanf("%d %d %d",&a,&b,&c);
        
        if( (a^2) + (b^2)  == (c^2) ){ printf("YES\n"); }
        else if( (b^2) + (c^2)  == (a^2)){ printf("YES\n"); } 
        else if( (c^2) + (b^2)  == (a^2)){ printf("YES\n"); }
        else{ printf("NO\n"); }
    }
}

C++: #include<iostream>

using namespace std;

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n,i,j,a[3],x,y,z;
	cin>>n;
	for(i=0;i<n;i++){
		for(j=0;j<3;j++){
	cin>>a[j];
		}
		sort(a,a+3);
	x=a[2]*a[2];
	y=a[1]*a[1];
	z=a[0]*a[0];
		if(x==(y+z)){
		cout<<"YES"<<endl;
		}
		else{
		cout<<"NO"<<endl;
		}
	}
return 0;
}

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

int main(){

	 array<int, 3> temp;
	 int N;

	 cin >> N;
	 
	 for (int i = 0; i < N; ++i) {
		 for (auto& a : temp) {
			 cin >> a;
		 }
		 sort(temp.begin(), temp.end());

		 if (temp[0] * temp[0] + temp[1] * temp[1] == temp[2] * temp[2]) {
			 cout << "YES" << endl;
		 }
		 else {
			 cout << "NO" << endl;
		 }
	 }
	return 0;
}