Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	// sc.Split(bufio.ScanLines)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(read())
	s := make([]int, 3)
	for i := 0; i < n; i++ {
		s[0], _ = strconv.Atoi(read())
		s[1], _ = strconv.Atoi(read())
		s[2], _ = strconv.Atoi(read())
		sort.Sort(sort.IntSlice(s))
		if (s[2] * s[2]) == ((s[0] * s[0]) + (s[1] * s[1])) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

using namespace std;

int main() {
	int n;
	scanf ("%d", &n);
	while (n--) {
		int a, b, c;
		scanf ("%d%d%d", &a, &b, &c);
		if (a + b > c && a + c > b && b + c > a) {
			a *= a, b *= b, c *= c;
			 if (a + b == c || a + c == b || b + c == a) printf ("YES\n");
			 else printf ("NO\n");
		}
		else printf ("NO\n");
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
#include<map>
#include<cmath>

using namespace std;

int main()
{
	int m,a,b,c;
	while(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 <iostream>
using namespace std;

int main(){
	int a,b,c,n,t;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		if(a<b){
			t=a;
			a=b;
			b=t;
		}
		if(a<c){
			t=a;
			a=c;
			c=t;
		}
		cout<<a*a==b*b+c*c ? "YES\n" : "NO\n";
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define IREP(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define IMAX INT_MAX
#define IMIN INT_MIN
#define LMAX LLONG_MAX
#define LMIN LLONG_MIN
template<typename T> inline void chmin(T &a, T b){ if(a > b) a = b; }
template<typename T> inline void chmax(T &a, T b){ if(a < b) a = b; }
template<typename T> inline void xch(T &a, T &b){ T w = a; a = b; b = w; }


int main() {
    int N; cin >> N;
    REP(notc, N){
        int sum = 0, max = 0;
        REP(i, 3){
            int a; cin >> a;
            sum += a * a;
            chmax(max, a * a);
        }
        cout << (((sum - max) == max) ? "YES" : "NO") << endl;
    }
    
    return 0;
}

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

#define MAX(a,b) (a > b ? a : b)
int main(void){
	int c;
	scanf("%d",&c);
	for(;c;c--){
		int x,y,z;
		bool f;
		scanf("%d%d%d",&x,&y,&z);
		if(MAX(z,MAX(x,y))==x)
			f = (pow(y,2) + pow(z,2) == pow(x,2));
		else{
			if(MAX(z,MAX(x,y))==y)
				f = (pow(x,2) + pow(z,2) == pow(y,2));
			else
				f= (pow(x,2)+pow(y,2)==pow(z,2));
		}
		std::cout << (f?"YES":"NO") << std::endl;
	}
	return 0;
}

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

void judge(int x, int y, int z, bool flag)
{    
    if (x * x + y * y == z * z){
        flag = true;
    }  
}


int main(void)
{
    int repeat, a, b, c;
    bool flag = false;
    scanf("%d", &repeat);
    for (int i = 0; i < repeat ; ++i){
        scanf("%d %d %d", &a, &b, &c); 
        judge (a, b, c, flag); 
        judge (b, c, a, flag);
        judge (c, a, b, flag);
        if (flag == true){    
            printf("YES\n");
        }else{	
            printf("NO\n");
        }
    }
    return 0;        
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <climits>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <deque>
#include <list>
#include <map>
#include <set>
using namespace std;

typedef long long LL;
typedef unsigned int ui;
typedef unsigned long long ULL;

typedef pair < int , int > ii;
typedef pair < LL  , LL  > ll;

typedef vector <int>  vint;
typedef vector <bool> vbool;
typedef vector <long> vlong;

#define sz(x)			((int)x.size())
#define tin(x)			scanf("%d",&x)
#define all(x)			x.begin(),x.end()
#define Set(b,a)		memset(b,a,sizeof b)
#define print1(x)		printf("Case %d:",x++)
#define tin2(x,y)		scanf("%d%d",&x,&y)
#define tin3(x,y,z)		scanf("%d%d%d",&x,&y,&z)
#define loop(i,i0,in)	for(int i=i0 ; i<in ; i++)
#define rep(i,n)		for(int i=0 ; i<(n) ; i++)
#define _rep(i,n)		for(int i=n-1 ; i>=0 ; i--)
#define _loop(i,in,i0)	for(int i=in-1 ; i>=i0 ; i--)
#define Fore(it, x)		for(typeof (x.begin()) it = x.begin(); it != x.end (); it++)

const int maxn = 5;

int seq[maxn];
     
int main()  
{  
#ifdef Online_Judge
	freopen("a.in","r",stdin);
#endif
	int t;
	tin(t);
	while(t--)
	{
		rep(i,3)
			tin(seq[i]);
		sort(seq,seq+3);
		if((seq[0]*seq[0])+(seq[1]*seq[1])==(seq[2]*seq[2]))
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n = 0;
    int a[3];
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[0] >> a[1] >> a[2];
        sort(a, a+3, greater<int>());
        if(pow(a[1], 2) + pow(a[2], 2) == pow(a[0], 2)){
            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;
    bool right_triangle = false;
    if (a * a + b * b == c * c) right_triangle = true;
    else if (b * b + c * c == a * a) right_triangle = true;
    else if (a * a + c * c == b * b) right_triangle = true;
    if (right_triangle)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

C++: #include<iostream>
using namespace std;
int main(){
	int n,z,y,x;
	cin>>n;
	while(n-->0){
		cin>>x>>y>>z;
		x*=x;
		y*=y;
		z*=z;
		if(x+y==z||x+z==y||y+z==x)
		cout<<"YES"<<endl;
		else
		cout<<"NO"<<endl;
	}
	return 0;
}

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


long long n,i,a[10];

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	for(i=0; i<n; i++){
		cin>>a[0]>>a[1]>>a[2];
		sort(a,a+3);
		if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]){
			cout<<"YES"<<'\n';
		}else
			cout<<"NO"<<'\n';
	}
	
	
	
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a[3];
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		cout << (hypot(a[0], a[1]) == a[2] ? "YES\n" : "NO\n");
	}
}

C++: #include <stdio.h>

int main (void)
{
	int n, i;
	int a, b, c;
	
	scanf("%d", &n);
	
	for (i=0; i<n; i++)
	{
		scanf("%d %d %d", &a, &b, &c);
		
		// find maximum
		if (a > b && a > c)
		{
			if (a*a == b*b + c*c)
			{
				printf("YES\n");
			}else
			{
				printf("NO\n");
			}
		}
		else if (b > a && b > c)
		{
			if (b*b == a*a + c*c)
			{
				printf("YES\n");
			}else
			{
				printf("NO\n");
			}
		}
		else
		{
			if (c*c == b*b + a*a)
			{
				printf("YES\n");
			}else
			{
				printf("NO\n");
			}
		}
	}
}