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<iostream>
using namespace std;
int main(void){
    int a{},b{},c{},n{};
    cin>>n;
    for(int i=0;i<n;i++){
        scanf("%d %d %d",&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;
    }
    return 0;
}

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

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

int main()
{
    int a,b,c,n;
    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<stdio.h>
int main()
{
	int a, b, c, d, c2;
	a = 0;
	b = 0;
	c = 0;
	d = 0;
	c2 = 0;
	while(scanf("%d %d %d", &a, &b, &c)(
	{
		d = a * a + b * b;
		c2 = c * c; 
		if( d == c2 )
		{
			printf("YES");
		}
		else
		{
			printf("NO");
		}
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <cstdio>

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;(i)>=0;(i)--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())

typedef long long ll;

int main(){
    
    int N;
    cin>>N;
    
    REP(i,N){
        int a,b,c;
        cin>>a>>b>>c;
        if(a+b<c)cout<<"NO"<<endl;
        else if(a+c<b)cout<<"NO"<<endl;
        else if(b+c<a)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
    
    return 0;
}

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

int main(){
	int a[3];
	int n;
	cin >> n;
	for(int i = 0 ; i < n; i++){
		for(int j = 0; j < 3;j++){
		cin >> a[j] ;
	}

	sort(a, a+3);
	if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1]) cout << "YES" << endl;
	else cout << "NO" << endl;


	}
	
	return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[3],b[3],l,k;
    cin>>n;
    for(l=0;l<n;l++){
        if(l>1000){
            break;
        }
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>1000||a[k]<=0){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()

int N;

int main() {
  cin >> N;
  rep(i, N) {
    int t[3];
    rep(i, 3) cin >> t[i];
    sort(t, t+3);
    int a = t[0], b = t[1], c = t[2];
    if (a*a + b*b == c*c) cout << "YES" << "\n";
    else                  cout << "NO"  << "\n";
  }
  return 0;
}

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

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

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  vector<int> arr(3);
  string ans[N];
  for(int i=0;i<N;++i){
    cin>>arr[0]>>arr[1]>>arr[2];
    sort(arr.begin(), arr.end());
    if(arr[0]*arr[0]+arr[1]*arr[1]==arr[2]*arr[2]) ans[i] = "YES";
    else ans[i] = "NO";
  }
  for(int i=0;i<N;++i) cout<<ans[i]<<endl;
}

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

int max(int a, int b) {
	return a > b ? a : b;
}

void swap(int *a, int *b) {
	int temp = *a;
	*a = *b;
	*b = temp;
/*
	*a ^= *b;
	*b ^= *c;
	*a ^= *b;
*/
}

int main() {
	int a, b, c, m, i, n, f;

	scanf("%d", &n);
	for (i = 0; i < n; ++i) {
		scanf("%d%d%d", &a, &b, &c);

/*
		// バブルソート
		if (b < c) swap(&b, &c);
		if (a < b) swap(&a, &b);
		if (b < c) swap(&b, &c);

		// a > b > c が保証される
		if (a * a == b * b + c * c)
			printf("YES");
		else
			printf("NO");
*/

		m = max(max(a, b), c);

		if (m*m == a*a + b*b + c*c - m*m)
			printf("YES");
		else
			printf("NO");

		puts("");
	}

	return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
	int N,E[3];
	scanf("%d",&N);
	for(int i=0;i<N;i++) {
		for(int j=0;j<3;j++) scanf("%d",&E[j]);
		sort(E,E+3);
		printf(((E[2]*E[2])==(E[0]*E[0]+E[1]*E[1]))?"YES\n":"NO\n");
	}
}

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

int check(int a,int b,int c){
	if(a*a+b*b==c*c) return 1;
	else return 0;
}

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b,c;
		int aa,bb,cc;
		cin>>a>>b>>c;
		aa=a<b?a:b;
		bb=a<b?b:a;
		cc=bb<c?c:bb;
		bb=bb<c?bb:c;
		int ans=check(aa,bb,cc);
		if(ans) cout<<"YES"<<endl;
		else    cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	int n; cin >> n;
	int a,b,c;
	while(scanf("%d %d %d",&a,&b,&c)!=EOF){
		if(a>c)swap(a,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>

using namespace std;

int main(){
    int N;
    cin>>N;
    if(cin.eof())return 0;

    while(N--){
        int x,y,z;
        cin>>x>>y>>z;
        if((x^2+y^2)==(z^2)||(x^2+z^2)==(y^2)||(y^2+z^2)==(x^2))cout<<"YES\n";
        else cout<<"NO\n";
    }
}

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||a*a+c*c==b*b||b*b+c*c==a*a){
			cout<<"yes"<<endl;
		}
		else
			cout<<"no"<<endl;
	}
	return 0;
}

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

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