Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

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

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

C++: //#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;


// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion


// Effective std
#pragma region ESTD
template<typename C, typename T>
constexpr int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F>
constexpr int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T, typename U>
constexpr void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U>
constexpr void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C>
constexpr void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred>
constexpr void sort(C& c, Pred p) { sort(ALL(c), p); }
template<typename C>
constexpr void reverse(C& c) { reverse(ALL(c)); }
#pragma endregion


// ?´???°
#pragma region PRIME
bool is_prime(unsigned n) {
  switch(n) {
    case 0:
    case 1: return false;
    case 2: return true;
  }
  if (n%2==0) return false;
  for (unsigned i=3; i*i<=n; i+=2)
    if (n%i==0) return false;
  return true;
}
#pragma endregion


// ??§??????/?°?????????????
#pragma region TRANSFORM
void mutal_tr(string &s) {
  for(int i=s.size(); i--;) {
    if(islower(s[i])) s[i] = toupper(s[i]);
    else if (isupper(s[i])) s[i] = tolower(s[i]);
  }
}
void to_upper(string &s) { for(int i=s.size(); i--;) s[i] = toupper(s[i]); }
void to_lower(string &s) { for(int i=s.size(); i--;) s[i] = tolower(s[i]); }
#pragma endregion


// ??????
#pragma region SET
template<class T>
set<T> intersection(const set<T>& sa, const set<T>& sb) {
  set<T> ret;
  for(T a : sa) if(sb.find(a) != sb.end()) ret.insert(a);
  return ret;
}
#pragma endregion

// Union Find
#pragma region UF
struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) {}
  bool union_set(int x, int y) {
    x = root(x); y = root(y);
    if(x!=y) {
      if(data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool find_set(int x, int y) { return root(x) == root(y); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  int size(int x) { return -data[root(x)]; }
};
#pragma endregion


// ?????°
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-9)
#define MOD (int)(1e9+7)
#pragma endregion

int main() {
    int n;
    cin >> n;
    rep(i,n) {
      int a, b, c;
      vi v;
      cin >> a >> b >> c;
      v.push_back(a);
      v.push_back(b);
      v.push_back(c);
      sort(v);

      if(pow(v[0],2)+pow(v[1],2)==pow(v[2],2)) P("YES");
      else P("NO");
    }
  return 0;
}

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

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

int main() {
	int loop;
	cin >> loop;
	bool isRight[loop];
	for (int i = 0; i < loop; i++) {
		int num[3];
		int tmp;
		cin >> num[0] >> num[1] >> num[2];
		if (num[0] < num[1]) {
			if (num[1] < num[2]) {
				tmp = num[0];
				num[0] = num[2];
				num[2] = tmp; 
			} else {
				tmp = num[0];
				num[0] = num[1];
				num[1] = tmp; 
			}
		} else if (num[0] < num[2]) {
				tmp = num[0];
				num[0] = num[2];
				num[2] = tmp; 
		}

		if (num[0] * num[0] == num[1] * num[1] + num[2] * num[2]) {
			isRight[i] = true;
		} else {
			isRight[i] = false;
		}
	}
	for (int i = 0; i < loop; i++) {
		cout << (isRight[i] ? "YES" : "NO") << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
 
#define MAX 1000
#define MIN 1
 
using namespace std;
 
int main() {
 int i = 0,j;
 int n;
 int side[3];
 bool cnt = false;
 vector<string> judge;
 
 cin >> n;
 
 while(i < n) {
  cin >> side[0] >> side[1] >> side[2];
 
  for(j = 0;j < 3;++j) {
   if((side[j] < MIN) || (side[j] > MAX)) {
    cnt = true;
   }
  }
 
  if(cnt == true) continue; 
 
  sort(side, side + 3);
 
  if(((side[0] % 3) == 0) && ((side[1] % 4) == 0) && ((side[2] % 5) == 0)) {
   judge.push_back("YES");
  } else {
   judge.push_back("NO");
  }

  ++i;
 }
 
 for(i = 0;i < judge.size();++i) {
  cout << judge.at(i) << endl;
 }
 
 return 0;
}

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

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
 
typedef long long ll;
using namespace std;
 
int main() {
  int n;
  cin >> n;
  int a[n],b[n],c[n];
  
  rep(i,0,n){
    cin >> a[i] >> b[i] >> c[i];
  }

  rep(i,0,n){
    if(a[i] < b[i]){
      swap(a[i],b[i]);
    }
    if(a[i] < c[i]){
      swap(a[i],c[i]);
    }
    if(pow(a[i],2) == pow(b[i],2)+pow(c[i],2)){
      puts("YES");
    }
    else{
      puts("NO");
    }
  }
  return 0;
}

C++: #include <stdio.h>

void judge_right_triangle(int a, int b, int c);

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