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++: /* AOJ0003 */
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  while(n--){
    int a, b, c;
    cin >> a >> b >> c;
    if(a < b) swap(a, b);
    if(a < c) swap(a, c);
    cout << (a * a == b * b + c * c ? "YES" : "NO" ) << endl;
  }
  return 0;
}

C++: #include<stdio.h>
int main()
{
	int x,N,L1,L2,L3,max,a1,a2;
	scanf("%d",&N);
	for(x=0; x<N; x++)
	{
		max=1;
		scanf("%d %d %d",&L1,&L2,&L3);
		if(L1<L2)
			max=2;
		if(L2<L3)
			max=3;
		if(max==1)
		{
			a1=L1*L1;
			a2=L2*L2+L3*L3;
			if(a1==a2)
				printf("YES\n");
			else
				printf("NO\n");
		}
		if(max==2)
		{
			a1=L2*L2;
			a2=L1*L1+L3*L3;
			if(a1==a2)
				printf("YES\n");
			else
				printf("NO\n");
		}
		if(max==3)
		{
			a1=L3*L3;
			a2=L1*L1+L2*L2;
			if(a1==a2)
				printf("YES\n");
			else
				printf("NO\n");
		}
	}
	return 0;
}

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

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

    int n,a,b,c;
    bool f;
    std::cin >> n;
    while (std::cin >> a >> b >> c) {
        f = false;
        if (c*c == a*a+b*b) {
            f = true;
        } else if (a*a == b*b+c*c) {
            f = true;
        } else if (b*b == c*c+a*a) {
            f = true;
        } else {
            std::cout << "NO" << std::endl;
        }
        if (f) {
            std::cout << "YES" << std::endl;
        }
    }
    return EXIT_SUCCESS;
}

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"); }
    }
}