Go: package main

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

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)
		fmt.Fprintln(out, checkTriangle(data))
	}
}

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
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}
func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

C++: #include <stdio.h>
#include <stdlib.h> 
#include <math.h>
int main ()
{
	long a,b,c;
	int n;
	while(scanf("%d",&n)){
		for(int i=0; i<n; i++){
			scanf("%ld %ld %ld",&a,&b,&c);
			if(abs(a*a-b*b)==c*c||a*a+b*b==c*c){
				printf("YES\n");
			}
			else{
				printf("NO\n");
			}
		}
	}
	return 0;
}

C++: #include<stdio.h>


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

	}
	return 0;
}

C++: 
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18



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

	for (int i = 0; i < n; i++) {
		vector<int>e(3);
		
		cin >> e[0] >> e[1] >> e[2];

		sort(e.begin(), e.end());

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
int main(){
  using namespace std;
  int N;
  cin >> N;
  for(int i = 0; i < N; i++){
    vector<int> edge(3);
    for(int j = 0; j < 3; j++){
      cin >> edge[j];
    }
    sort(edge.begin(), edge.end());
    int l,m,s;
    s = edge[0];
    m = edge[1];
    l = edge[2];
    if(l*l == m*m + s*s){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,b,c,n;
    cin >> n;
    for (;0<n;n--){
        cin >> a >> b >> c;
        if (a^2+b^2!=c^2 && a^2+c^2!=b^2 && b^2+c^2!=a^2)
            cout << "NO" << endl;
        else
            cout << "YES" << endl;
    }
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int a[3];
	int n; cin >> n;
	rep(i,n) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[2] * a[2] == a[0] * a[0] + a[1] * a[1])puts("YES");
		else puts("NO");
	}
	return 0;
}

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

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

C++: #include<stdio.h>

int main(){
 int n,a,b,c,i,aa,bb,cc;

 scanf("%d",&n);
 for(i=0;i<n;i++){
  scanf("%d %d %d",&a,&b,&c);
  aa=a*a;
  bb=b*b;
  cc=c*c;
  if((aa+bb)==cc||
     (cc+bb)==aa||
     (cc+aa)==bb){
   printf("YES\n");
  }else{
   printf("NO\n");
  }
 }
 return 0;
}

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';
		}
	}
}