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>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
  int n;
  cin >> n;
  for ( int i = 0; i < n; i++ ) {
    vector<int> v;
    int t;
    for ( int j = 0; j < 3; j++ ) {
      cin >> t;
      v.push_back( t );
    }
    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 <iostream>
int main(){
	int a,b,c;
	std::cin>>a>>b>>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;

		system("pause");
		
	 return 0;
	}

C++: #include<iostream>
using namespace std;
class DigitNumber{ 
    public:
        void solve(int a,int b){
            string sum=to_string(a+b);
            if(sum=="0")cout<<0<<endl;
            else cout<<sum.length()<<endl;
        }
};
int main(){
    DigitNumber inst;
    int a,b;
    while(cin>>a>>b){ 
        inst.solve(a,b);
    }
}

C++: #include<iostream>


using namespace std;

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

}

return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<cstdlib>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(void) {
	int N;
	cin>>N;
	REP(i, N) {
		vector<int> hoge(3);
		REP(j, 3) cin>>hoge[j];
		sort(ALL(hoge));
		if(hoge[0] * hoge[0] + hoge[1] * hoge[1] == hoge[2] * hoge[2])cout<<"YES"<<endl;
		else cout<<"NO"<<endl;

	}
}

C++: #include <cstdio>
#include <cmath>

bool triangle(int x, int y, int z) {
	return pow((double)x, 2) + pow((double)y, 2) == pow((double)z, 2);
}

int main(void) {
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		int x, y, z;
		scanf("%d %d %d", &x, &y, &z);
		if(triangle(x, y, z) || triangle(y, z, x) || triangle(z, x, y))
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

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

int main(){
	int a, b, c;

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

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

int main() {
  int N;
  cin >> N;
  for (auto i=0; i<N; i++) {
    int t[3];
    cin >> t[0] >> t[1] >> t[2];
    sort(t, t+3);
    cout << ( (t[0]*t[0] + t[1]*t[1] == t[2]*t[2]) ? "YES" : "NO" ) << endl;
  }
}

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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n; cin>>n;
	for(int i=0;i<n;++i){
		vector<int>v(3); for(auto&&j:v)cin>>j;
		sort(v.begin(),v.end());
		int&a=v.back(),&b=v.front(),&c=v.at(1);
		cout<<(a*a==b*b+c*c?"YES"s:"NO"s)<<"\n"s;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
/*
int main()
{
	int n, a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a >> b >> c;
		int m = max(a, max(b, c));
		int l = min(a, b);
		int n = min(b, c);
		if (l == n) {
			n = min(a, c);
		}
		if (m*m == n*n + l*l) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
    return 0;
}

*/
int main() {
	priority_queue<int> pq;
	int n, a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a;
		pq.push(a);

		int a, b, c;
		a = pq.top(); pq.pop();
		b = pq.top(); pq.pop();
		c = pq.top(); pq.pop();
		cout << (a*a == b*b + c*c ? "YES" : "NO") << endl;
	}
	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>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==a*a+c*c)
                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++: #include <iostream>
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*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 <iostream>
#include <algorithm>

using namespace std;

int main() {
    int n;

    cin >> n;

    while (n--) {
        int a[3];

        cin >> a[0] >> a[1] >> a[2];
        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<stdio.h>
main()
{
    int i,j,k,l,a,b,c,d,e,p,q,x,y,z;
    scanf("%d",&p);
    for(q=1; q<=p; q++)
    {
        scanf("%d %d %d",&a,&b,&c);
        if(a>b&&a>c)
        {
            i=a;
            j=b;
            k=c;
        }
        else if(b>a&&b>c)
        {
            i=b;
            j=a;
            k=c;
        }
        else if(c>a&&c>b)
        {
            i=c;
            j=a;
            k=b;
        }
        x=i*i;
        y=j*j;
        z=k*k;
        if(x==y+z)
        {
            printf("YES\n");
        }
        else
        {
            printf("NO\n");
        }
    }
    return 0;
}

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

using namespace std;

int main(void)
{
	int a[3];
	int n;
	
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		for (int j = 0; j < 3; j++){
			scanf("%d", &a[j]);
		}
		
		sort(a, a + 3);
		reverse(a, a + 3);
		
		if (a[0] * a[0] == (a[1] * a[1]) + (a[2] * a[2])){
			puts("YES");
		}
		else {
			puts("NO");
		}
	}
	
	return (0);
}