Go: // 九九を出すだけ
package main
import (
	"fmt"
	"os"
	"bufio"
	"strconv"
	"sort"
)

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)
	    sort.Ints(data)
	    if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
	        fmt.Fprintln(out, "YES")
	    }else{
	        fmt.Fprintln(out, "NO")
	    }
	}
}

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
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
 
#define MAX 1000
#define MIN 1
 
using namespace std;
 
bool right(int a,int b,int c) {
 if(((a * a) + (b * b)) == (c * c)) {
  return true;
 } else {
  return false;
 }
}

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((right(side[0],side[1],side[2]) == true) {
   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 <stdio.h>
#include <algorithm.h>

int main()
{
 int n[3],t;
 scanf("%d", &t);
 while(t!=0){
  scanf("%d %d %d", &n[0],&n[1], &n[2]);
  sort(n,n+3);

  if((n[0]*n[0] + n[1]*n[1]) == n[2]*n[2]) printf("YES\n");
  else printf("NO\n");
  t--;
 }
return 0;

}

C++: #pragma GCC optimize "O3"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <cassert>
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#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 FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define REP_FROM(i,m,n) for (int i = (m); (i) < int(n); ++(i))
#define REP_REV(i,n) for (int i = (n)-1; (i) >= 0; --(i))
#define REP_FROMREV(i,m,n) for (int i = (n)-1; (i) >= int(m); --(i))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#ifndef LOCAL
#define cerr if (false) cerr
#endif
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

template <class T> inline void setmax(T & a, T const & b) { a = max(a, b); }
template <class T> inline void setmin(T & a, T const & b) { a = min(a, b); }
template <class T> T sq(T x) { return x * x; }
template <class T> T clamp(T a, T l, T r) { return min(max(a, l), r); } // [l, r]
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int isRightTriangle(int a, int b, int c) {
	if(a > b && a > c)
		return b*b+c*c == a*a;
	else if(b > a && b > c)
		return a*a+c*c == b*b;
	else
		return a*a+b*b == c*c;
}

int main(int argc, char *argv[]) {
	// Something to do
	int n;
	cin >> n;
	REP(i, n) {
		int a, b, c;
		cin >> a >> b >> c;
		if(isRightTriangle(a,b,c))
			cout << "YES" << endl;
		else
			cout << "NO"  << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int N;
int 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;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

C++: #include <iostream>

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

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

    std::cin >> n;
    while (std::cin >> a >> b >> c) {
        if (is_right_triangle(a, b, c)) {
            std::cout << "Yes" << std::endl;
        } else {
            std::cout << "No" << std::endl;
        }
    }

    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

int main ()
{
    int n;
    vector<int> l;
    cin>>n;
    
    for (int i=0; i<n; i++) {
        for (int i=0; i<3; i++) {
            int d;cin>>d;
            l.push_back(d);
        }
        sort(l.begin(), l.end());
        if (l[0]*l[0]+l[1]*l[1]==l[2]*l[2]) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

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

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

C++: #include<cstdio>

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,j=0;
  int a[3];
  cin>>n;
  while(j!=n){
    for(int i=0;i<3;i++){
      cin>>a[i];
    }
    sort(a,a+3);
    if(a[2]*a[2]==a[1]*a[1]+a[0]*a[0]){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }
    j++;
  }
  return 0;
}

C++: int main(){ return 0;}