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>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
using namespace std;
typedef long long  ll;

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

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

int main(){
	int abc[3], N;
	cin << N;
	for(int i = 0; i < N; i++){
		cin >> abc[0] >> abc[1] >> abc[2];
		while(!(((abc[0] >= 1)&&(abc[0] <= 1000))&&
				((abc[1] >= 1)&&(abc[1] <= 1000))&&
				((abc[2] >= 1)&&(abc[2] <= 1000)))){
			cout << "wrong value\n";
			cin >> abc[0] >> abc[1] >> abc[2];
		}
		sort(abc, abc+3);
		if((pow(abc[0], 2) + pow(abc[1], 2)) == pow(abc[2], 2)){
			cout << "YES\n";
		}else{
			cout << "NO\n";
		}
	}
    return 0;
}

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

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

int main(void)
{

	int a, b, c, n;
	bool f = false;

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		f = false;
		cin >> a >> b >> c;
		if (a * a + b * b == c * c) f = true;
		if (b * b + c * c == a * a) f = true;
		if (c * c + a * a == b * b) f = true;
		if (f == true) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int p=0;p<n;p++){
		int a,b,c,d;
		cin>>a>>b>>c;
		if(c<a){
			d=c;
			c=a;
			a=d;
		}
		if(c<b){
			d=c;
			c=b;
			b=d;
		}
		int aa=a*a,bb=b*b,cc=c*c;
		if(aa+bb==cc){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
}

C++: #include <stdio.h>

int check(int n1, int n2 , int n3){
	int a,b;
	a = n1*n1;
	b = n2*n2 + n3*n3;
	return (a==b)? 1 : 0 ;
}

int main(){
	int N,n1,n2,n3;

	scanf("%d", &N);
	for(int i=0 ; i<N ; i++){
		scanf("%d %d %d", &n1 , &n2 , &n3);
		if( check(n1,n2,n3)==1 || check(n2,n1,n3)==1 || check(n3,n2,n1)==1){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}

	return 0;
}

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

int main(){

	int a,b,c,n;
	cin >> n;

	for(int i=0; i<n; i++){
		cin >> a >> b >> c;
		if(a*a+b*b==c*c){ cout << "Yes" << endl;}
		else if(a*a+c*c==b*b){ cout << "Yes" << endl;}
		else if(b*b+c*c==a*a){ cout << "Yes" << endl;}
		else{ cout << "No" << endl;}
	}
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>

using namespace std;


vector<string> splitString(const string& str, const string& separator = " ") {
	vector<string> ret;

	std::size_t bp, ep;
	bp = ep = 0;
	while((ep = str.find_first_of(separator, bp)) != string::npos){
		if(bp != ep){
			ret.push_back(string(str.begin() + bp, str.begin() + ep));
		}
		bp = ep + 1;
	}

	if(bp <= str.size() - 1){
		ret.push_back(string(str.begin() + bp, str.end()));
	}

	return ret;
}

template <class T>
T convertStringToNumber(const string& str) {
	stringstream ss;
	T ret;

	ss << str;
	ss >> ret;

	return ret;
}


void inputData(vector<string>& data_set) {
	string buffer;

	getline(cin, buffer);
	int n = convertStringToNumber<int>(buffer);

	for(int i = 0; i < n; ++i) {
		getline(cin, buffer);
		data_set.push_back(buffer);
	}
}

bool isRightTriangle(const vector<int>& edge_set) {
	int max_index = 0;

	if(edge_set[max_index] < edge_set[(max_index+1)%3])
		max_index = (max_index+1)%3; 
	if(edge_set[max_index] < edge_set[(max_index+2)%3])
		max_index = (max_index+2)%3; 

	return ((edge_set[max_index] * edge_set[max_index]) ==
				(edge_set[(max_index+1)%3] * edge_set[(max_index+1)%3]
				+ edge_set[(max_index+2)%3] * edge_set[(max_index+2)%3]));
}


vector<bool> evaluateTriangle(const vector<string>& data_str) {
	vector<bool> ret(data_str.size());

	for(int i = 0; i < data_str.size(); ++i) {
		auto temp = splitString(data_str[i]);
		vector<int> buff { convertStringToNumber<int>(temp[0]),
							convertStringToNumber<int>(temp[1]),
							convertStringToNumber<int>(temp[2])};

		ret[i] = isRightTriangle(buff);
	}

	return ret;
}


void doAllProcess() {
	vector<string> buffer;

	inputData(buffer);

	vector<bool> ret = evaluateTriangle(buffer);

	for(int i = 0; i < ret.size(); ++i)
		std::cout << (ret[i] ? "YES" : "NO") << std::endl;
}



int main() {
	doAllProcess();

	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 || a * a + c * c == b * b) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

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

C++: #include<iostream>
using namespace std;
int main(){
  int A[3],N[3],n;
  cin>>n;
    for(int i=0;i<n;i++){
      for(int i=0;i<3;i++) scanf("%d",&A[i]);
      for(int i=0;i<3;i++){
        for(int j=i;j<3;j++){
          if(A[i]<A[j]) swap(A[i],A[j]);
        }
      }
      for(int i=0;i<3;i++) N[i]=A[i]*A[i];
      if(N[0]==N[1]+N[2]) cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
    }
  return 0;
}

C++: #include<stdio.h>
int main(void){
	int i,N;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		int j,a[3]={},b[3]={};
		for(j=0;j<3;j++){
			scanf("%d",&a[j]);
			}
		
		b[0]=a[0];
		if(a[0]<a[1]){
			b[1]=a[0];
			b[0]=a[1];
		}else b[1]=a[1];
		if(b[0]<a[2]){
			b[2]=b[1];
			b[1]=b[0];
			b[0]=a[2];
		}else if(b[1]<a[2]&&a[2]<b[0]){
			b[2]=b[1];
			b[1]=a[2];
		}else b[2]=a[2];
		
	
		if(b[0]*b[0]==b[1]*b[1]+b[2]*b[2])
			puts("YES");
		else puts("NO");
	}
	return 0;
}

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

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

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a >> b >> c;

		if (pow(a, 2)  == pow(b, 2) + pow(c, 2)
			||pow(b, 2)  == pow(c, 2) + pow(a, 2)
			||pow(c, 2)  == pow(a, 2) + pow(b, 2))
		{cout << "YES" << endl;}
		else {cout << "NO" << endl;}
	}

	return 0;
}

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