Go: package main

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

func main() {
	n, err := strconv.Atoi(strScan())
	if err != nil {
		fmt.Println("数字を入力して下さい。")
	} else {
		var counter int = n
		var judgeArr []string
		scanner := bufio.NewScanner(os.Stdin)
		for scanner.Scan() {
			strArr := strings.Fields(scanner.Text())
			castNumArr := StringToInt(strArr)
			judgeArr = append(judgeArr, checkTriangle(castNumArr))
			counter--
			if counter == 0 {
				break
			}
		}
		for _, v := range judgeArr {
			fmt.Println(v)
		}
	}
}

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"
	} else {
		return "NO"
	}
}

func Sq(x int) int {
	return x * x
}

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

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

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

C++: #include<iostream>
#include<algorithm>
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>=b && a>=c){
      if(a*a == b*b + c*c)cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
    }
    if(b>a && b>c){
      if(b*b == c*c + a*a)cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
    }
    if(c>a && c>b){
      if(c*c == b*b + a*a)cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
    }
  }
  return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vpii> vvpii;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return !odd(n); }
template<typename V> typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

bool f(int a, int b, int c) {
  return a * a + b * b == c * c;
}

void solve() {
  int n;
  cin >> n;
  rep(_, n) {
    int a, b, c;
    cin >> a >> b >> c;
    cout << (f(a, b, c) || f(b, c, a) || f(c, a, b) ? "YES" : "NO") << endl;
  }
}

C++: #include <iostream>

int main() {
	int N;
	std::cin >> N;

	for( int i=0; i<N; ++i ) {
		int a=0, b=0, c=0;
		std::cin >> a >> b >> c;
		std::cout << (( a*a + b*b == c*c )?"YES":"NO") << std::endl; 
	}
}

C++: int main(void)
{
	int a,b,c,i,k;
	int sort[3];
	int num;
	int max,mid,min;
	int d=1,n=3;
	num<=1000;
	
	scanf("%d",&num);
	
	
    while(d<=num){
		scanf("%d %d %d",&sort[0],&sort[1],&sort[2]);
		for(n=3;n<=1;n--){
			for(i=0;i<=n-1;i++){
				if(sort[i]>sort[i+1]){
						k=sort[i];
						sort[i]=sort[i+1];
						sort[i+1]=k;
					}
			}
		}
		max=sort[2];
		mid=sort[1];
		min=sort[0];
		if(max*max==mid*mid+min*min){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
		d++;
	}
	return 0;
}

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

using namespace std;

void f(){int a,b,c;
    cin>>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;
      }
}
int main(){
	int n,i;
	cin>>n;
	for(i=0;i<n;++i){
	f();
	}
    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    int a,b,c,d,e,n;
   cin >> n;
   while(n--)
   {
             cin >> a >> b >> c;
             if(c > b && c > a )
             {
               d= (a*a) + (b * b);
               e = (c*c);
             }
             else if( b > c && b > a )
             {
                  d = (a * a) + (c *c);
                  e = (b*b);
                  
             }
             else if(a > c && a > b)
             {
                  d = (b* b) + (c*c);
                  e = (a*a);
             }
             else{
                   d= (a*a) + (b * b);
               e = (c*c);
                  
                  }
             
             if( d == e)
             {
                 cout << "YES\n" ;
                 
             }
             else 
             {
                  cout << "NO\n";
             }
   }
    return 0;
}

C++: #include <stdio.h>

int hantei(int l1,int l2,int l3);
//??´?§?????§???¢??????????????????????????????????????????

int main(void)
{
	int kaisuu, l1, l2, l3;
	int kekka[1000];
	scanf("%d", &kaisuu);
	for(int i = 0; i < kaisuu; i++) {
		scanf("%d %d %d", &l1, &l2, &l3);
		kekka[i] = hantei(l1, l2, l3);
	}
	for(int i = 0; i < kaisuu; i++) {
		if(kekka[i] == 1) {
		 	printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

int hantei(int l1,int l2,int l3)
{
	int llong, lshort1, lshort2;
	if(l1 <= l2) {
		lshort1 = l1 * l1;
		if(l2 <= l3) {
			lshort2 = l2 * l2;
			llong = l3 * l3;
		}else{
			lshort2 = l3 * l3;
			llong = l2 * l2;
		}
	}else{
		lshort1 = l2 * l2;
		if(l1 <= l3) {
			lshort2 = l1 * l1;
			llong = l3 * l3;
		}else{
			lshort2 = l3 * l3;
			llong = l1 * l1;
		}
	}
	if(lshort1+ lshort2 == llong) {
		return 1;
	}else{
		return 0;
	}
}

C++: #include <bits/stdc++.h>
#include<cmath>
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin>>n;
    while (n--)
        {
            int a,b,c;
            cin>>a>>b>>c;
            if (a*a + b*b-c*c == 0)
            
                cout<<"YES"<<endl;
                else 
                    cout<<"NO"<<endl;
            
        }
    return 0;
}

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

void F(int *a, int*b) {
	int x;
	x = *a;
	*a = *b;
	*b = x;
}

int main() {
	int n, a, b, c;
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> a >> b >> c;
		if (c < a)
			F(&c, &a);
		if (c < b)
			F(&c, &b);

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

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

int main() {
    int N;
    cin >> N;
    while (N--) {
        vector<int> a(3);
        for (int i = 0; i < 3; ++i) cin >> a[i];
        sort(a.begin(), a.end());
        cout << (a[0] * a[0] + a[1] * a[1] == a[2] * a[2] ? "YES" : "NO") << endl;
    }
}

C++: main(a,b,c){
for(scanf("%*d");~scanf("%d%d%d",&a,&b,&c);puts(((a+b-c)&&(a+c-b)&&(b+c-a))?"NO":"YES")){a*=a,b*=b,c*=c;}
exit(0);
}

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

int N,a,b,c;

int main(){
  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;
    }
  }
}