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 <iostream>
#include <cstdio> 
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <complex>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

#ifndef typeof
#define typeof __typeof__
#endif // typeof
 
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(typeof((c).rbegin()) i = (c).rbegin(); i != (c).rend(); i++)
#define repby(i, a, b, step) for(typeof(b) i = (a); i < (b); i += (step))
#define repab(i, a, b) repby(i, (a), (b), 1)
#define rep(i, n) repab(i, 0, (n))
#define pb push_back
#define sz(c) int((c).size())

bool judge(vi &v)
{
  sort(rall(v));

  return v[0]*v[0] == v[1]*v[1] + v[2]*v[2];
}

int main(int argc, char **argv)
{
  int n, x, y, z;
  vi v;

  cin >> n;
  while (n--) {
    cin >> x >> y >> z; 
    v.pb(x);
    v.pb(y);
    v.pb(z);
    cout << (judge(v) ? "YES" : "NO") << endl;
    v.clear();
  }

  return 0;
}

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

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define sqr(x) x*x

int main(){
  int n, f = 0;
  int s1, s2, s3;

  scanf("%d",&n);
  while(n--){
    scanf("%d %d %d",&s1,&s2,&s3);
    f = sqr(s1) == sqr(s2) + sqr(s3) ? 1 : 0;
    f = sqr(s2) == sqr(s1) + sqr(s3) ? 1 : 0;
    f = sqr(s3) == sqr(s1) + sqr(s2) ? 1 : 0;

    if(f) puts("YES");
    else puts("NO");
  }

  return 0;
}

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

int main(){
  int a,b,c;
  std::cin>>a;
  std::cin>>b;
  std::cin>>c;
  if      (a*a==b*b+c*c) std::cout<<"YES"<<std::endl;
  else if(b*b==a*a+c*c) std::cout<<"YES"<<std::endl;
  else if(c*c==a*a+b*b) std::cout<<"YES"<<std::endl;
  else std::cout<<"NO"<<std::endl;
  

	
	return 0;
}

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

int main()
{
	int N;

	std::cin >> N;

	std::vector<int> m(3);

	for(int i=0;i<N;++i)
	{
		for(int j=0;j<3;++j)
		{
			std::cin >> m[j];
		}
		std::sort(m.begin(),m.end());

		if(m[2]*m[2]==m[0]*m[0]+m[1]*m[1])
		{
			std::cout << "YES" << '\n';
		}
		else
		{
			std::cout << "NO" << '\n';
		}
	}
}

C++: #include<iostream>
#include<cstdio>
#include<stdio.h>
#include<string>
using namespace std;
int main() {
	long judge[1000],i,n,a[1000],b[1000],c[1000];

	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a[i] >> b[i] >> c[i];
		if (a[i]*a[i] + b[i]*b[i] == c[i]*c[i]) {
			judge[i] = true;
			cout << "YES" << endl;
		}
		else {
			judge[i] = false;
			cout << "NO" << endl;
		}

	}
	
	
	

	return 0;
}

C++: //
//  main.cpp
//  Sample
//
//  Created by h3037183 on 2017/07/31.
//  Copyright ?? 2017??´ ?°????. All rights reserved.
//

#include <iostream>
using namespace std;
int main(){
    int a,b,c,i;
    cin>>i;
    for(int n=0;n<i;n++){
        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 == b * b + a * a){
                cout<<"YES"<<endl;
        }else{cout<<"NO"<<endl;}
    }
    return 0;
}

C++: #include <iostream>

int main()
{
	int data_num;
	std::cin >> data_num;
	while (data_num >= 1) {
		int x1, x2, x3;
		std::cin >> x1 >> x2 >> x3;
		if (x1 * x1 == x2 * x2 + x3 * x3) {
			std::cout << "YES" << std::endl;
		} else if (x2 * x2 == x3 * x3 + x1 * x1) {
			std::cout << "YES" << std::endl;
		} else if (x3 * x3 == x1 * x1 + x2 * x2) {
			std::cout << "YES" << std::endl;
		} else {
			std::cout << "NO" << std::endl;
		}
		data_num--;
	}
	return 0;
}

C++: #include <stdio.h> 
#include <algorithm> 
using namespace std; 
int main(){
 int i, n,j,cnt = 0,tri[3]; 
 scanf("%d",&n);
 for (i = 0; i < n; i++){
  for (j = 0; j < 3; j++){
   scanf("%d",&tri[j]);
  }
  sort(tri,tri+3);
  if (tri[0]*tri[0] + tri[1]*tri[1] = tri[2]*tri[2]) cnt++;
 } printf("%d\n",cnt);
 return 0;
 }

C++: #include <bits/stdc++.h>
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) swap(a, b); 
if(b > c) swap(b, c);
if(a * a + b * b == c * c)
  cout << "YES" << endl; 
else
  cout << "NO" << endl; 
}
}

C++: #include <iostream>
#include "string"
#include <math.h>

using namespace std;


int main(){
    int a,b,c;
    int N;
    string *str;
    
    cin >> N;
    
    str=(string *)malloc(sizeof(string)*N);
    
    for(int i=0;i<N;i++){
        cin>>a>>b>>c;
        if(c==sqrt((pow((double)a,(double)2)+pow((double)b,(double)2)))) str[i]="YES";
        else str[i]="NO";
    }
    
    for(int i=0;i<N;i++) cout<<str[i]<<endl;
    
    free(str);
    
    return 0;
}

C++: #include<stdio.h>
int main(){
  int n,i,j,l;
  int data[3];
  scanf("%d",&n); 
  for(l=0;l<n;l++){
    scanf("%d %d %d",&data[0],&data[1],&data[2]);
    for(i=0;i<2;i++){
      for(j=0;j<2-i;i++){
	if(data[j]>data[j+1]){
	  int temp;
	  temp=data[j];
	  data[j]=data[j+1];
	  data[j+1]=temp;
	}
      }
    }
    if(data[0]*data[0]+data[1]*data[1]==data[2]*data[2]){
      printf("YES\n");
    } else{
      printf("NO\n");
    }
  }
  return(0);
}

C++: #include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long ll;

using namespace std;
int kaijo(int n){
	int ans = 1;
	if (n != 0){
		for (int i = 0; i < n; i++){
			ans *= (n - i);
		}
	}
	else{
		ans = 1;
	}
	return ans;
}

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

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

string isTriangle(int a[3]);

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

C++: #include<iostream>
#include<string>
using namespace std;
string heihou(int a,int b,int c)
{
	if (a*a == b*b + c*c || b*b == a*a + c*c || c*c==a*a+b*b){
		return "YES";
	}
	else{
		return "NO";
	}
}
int main()
{
	int dataset[999][2];
	int i = 0;
	int l;
	cin >> l;
	while (i<l){
		cin >> dataset[i][0] >> dataset[i][1] >> dataset[i][2]; 
		i++;
	}
	for (int j = 0; j < i; j++){
		cout << heihou(dataset[j][0], dataset[j][1], dataset[j][2])<< endl;
	}
	getchar();
	getchar();
	return 0;
}

C++: #include<stdio.h>

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

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

	for(int i=0;i<count;i++)
	{
		int a,b,c;
		scanf("%d %d %d",&a,&b,&c);
		if(a<b)
			swap(&a,&b);
		if(a<c)
			swap(&a,&c);
		if(b<c)
			swap(&b,&c);
		if(a < b+c && a > b-c)
			printf("YES\n");
		else
			printf("NO\n");
	}

}