Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	nQueries := nextInt()
	for i := 0; i < nQueries; i++ {
		lengths := []int{nextInt(), nextInt(), nextInt()}
		sort.Slice(lengths, func(i, j int) bool { return lengths[i] > lengths[j] })
		if math.Pow(float64(lengths[0]), 2) == math.Pow(float64(lengths[1]), 2)+math.Pow(float64(lengths[2]), 2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <math.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
using namespace std;
#define rep(I,N) for(int I = 0; I < (int)(N); I++)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;

int main(void){
	int N;
	cin >> N;
	rep(k, N){
		int a, b, c;
		cin >> a >> b >> c;
		a = pow(a, 2);
		b = pow(b, 2);
		c = pow(c, 2);
		bool flag = false;
		if(c == sqrt(a + b))flag = true;
		if(b == sqrt(a + c))flag = true;
		if(a == sqrt(b + c))flag = true;
		if(flag)cout << "YES"<<endl;
		else FIN("NO");

	}

	return 0;	
}

C++: #include <map>
#include <string>
#include <iostream>
#include<vector>
#include <set>
#include<math.h>
#include<algorithm>

using namespace std;

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

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

int main()
{
	int nNum=0;
	cin>>nNum;
	int nIn[3]={0};
	while(nNum--)
	{
		cin>>nIn[0]>>nIn[1]>>nIn[2];
		int nMax=max(max(nIn[0],nIn[1]),nIn[2]);
		if(nMax==nIn[2])
		{
			swap(nIn[2],nIn[0]);
		}
		else if (nMax==nIn[1])
		{
			swap(nIn[1],nIn[0]);
		}
		if(nIn[0]*nIn[0]==nIn[1]*nIn[1]+nIn[2]*nIn[2])
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
bool isRightTriangle(int a,int b,int c){
    if(pow(a,2)==pow(b,2)+pow(c,2))return true;
    else return false;
}
int main(){
    int N;
    cin>>N;
    int tri[3][N];
    for (size_t i = 0; i < N; i++)
    {
        for (size_t j = 0; j < 3; j++)
        {
            cin>>tri[j][i];
            /* code */
        }
        /* code */
    }
    for (size_t i = 0; i < N; i++)
    {
        if(isRightTriangle(tri[0][i],tri[1][i],tri[2][i])||isRightTriangle(tri[1][i],tri[0][i],tri[2][i])||isRightTriangle(tri[2][i],tri[1][i],tri[0][i])){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
        /* code */
    }
    return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;cin >> n;
	for(int i = 0; i < n; i++){
		int l[3] = {};
		for(int j = 0; j < 3; j++){
			cin >> l[j];
		}
		bool flag = false;
		for(int j = 0; j < 3; j++){
			//printf("%d %d %d",l[j]*l[j],l[(j+1)%3]*l[(j+1)%3],l[(j+2)%3]*l[(j+2)%3]);
			if(l[j]*l[j] + l[(j+1)%3]*l[(j+1)%3] == l[(j+2)%3]*l[(j+2)%3]){
				flag = true;
				break;
			}
		}
		cout << (flag?"YES":"NO") << endl;
	}

	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <algorithm>
#include <limits.h>
#include <cmath>
#include <time.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define SQR(X) ((X)*(X))
int test = 0;
/* ここからが本編 */
int main(void)
{
  int i,j,k,l;
  int a[3];
  int n;
  cin >> n;
  while(cin >> a[0] >> a[1] >> a[2]) {
    sort(a,a+3);
    if(SQR(a[0]) + SQR(a[1]) == SQR(a[2])) {
      puts("YES");
    }
    else puts("NO");
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,b,c,count=0,n;
    cin>>n;
    while(cin>>a>>b>>c){
        count++;
    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;
        if(count==n)break;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;



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);
		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 <algorithm>
#include <cmath>
using namespace std;

bool is_Right_Triangle(int a, int b, int c){
  if(a > b) swap(a, b);
  if(a > c) swap(a, c);
  if(b > c) swap(b, c);
  if(a*a + b*b == c*c) return true;
  return false;
}

int main(){
  int n;
  cin >> n;
  int a, b, c;
  while(n--){
    cin >> a >> b >> c;
    printf("%s\n", is_Right_Triangle(a, b, c) ? "YES" : "NO");
  }
  return 0;
}

C++: //-------------
//include
//-------------
#include <map>
#include <list>
#include <cmath>
#include <vector>
#include <string>
#include <cctype>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
//-------------
//typedef
//-------------
typedef  long long LL;
typedef  vector<int> VI;
typedef  vector<double> VD;
typedef  string STR;
typedef  pair<int, int> PII;
typedef  vector<int, int> VII;
typedef  map<string, int> MSI;
//-------------
//utillty
//-------------
#define ALL(a)  (a).begin(),(a).end()
#define MK make_pair
#define PB push_back
#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 SORT(c) sort((c).begin(),(c).end())
#define COUT(a) cout<<a<<endl
#define POW2(a) pow(a, 2.0)
//-------------
//repetition
//-------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//-------------
//debug
//-------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumpl(c) REP(i,SZ(c))cerr<<#c<<i<<"="<<(c[i])<<endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const int MOD = 1000000007;
int main()
{
	int x;
	cin >> x;
	REP(i,x)
	{
		VD tri;
		REP(i, 3)
		{
			double temp;
			tri.push_back(temp);
		}
		SORT(tri);
		if (tri[2] == sqrt(POW2(tri[0]) + POW2(tri[1])))
		{
			COUT("YES");
		}
		else
		{
			COUT("NO");
		}
	}
	
#ifdef _DEBUG
	while(1);
#endif // _DEBUG

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

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

C++: #include <stdio.h>
//#include <iostream>
//#include <cstdlib>
//#include <cstring>

//using namespace std;

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

  scanf("%d",&n);

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

    if(a*a+b*b==c*c || b*b+c*c==a*a || c*c+a*a==b*b) printf("YES\n");
    else printf("NO\n");
  }
  
  return 0;
}

C++: #include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
vector<int>v;
int main(void)
{
    int testCase,n;
    scanf("%d",&testCase);
    while(testCase--){
        v.clear();
        int i=3;
        while(i--){
            scanf("%d",&n);
            v.push_back(n);
        }
        sort(v.begin(),v.end());
        if((v[0]*v[0]+v[1]*v[1])==(v[2]*v[2]))printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}