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>
using namespace std;
int main(){
  int n,a[3],b;
  cin>>n;
  for(int j=0;j<n;j++){
    b=0;
  cin>>a[0]>>a[1]>>a[2];
  if(a[0]*a[0]==a[1]*a[1]+a[2]*a[2])b=1;
  else if(a[1]*a[1]==a[0]*a[0]+a[2]*a[2])b=1;
  else if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1])b=1;
  if(b==1)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  }
}

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

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

	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int N,a,b,c,A,B,C;

int main(){
    cin>>N;
    rep(i,N){
        cin>>a>>b>>c;
        A=a*a;
        B=b*b;
        C=c*c;
        if(A+B==C||B+C==A||C+A==B){
            out("YES");
        }
        else{
            out("NO");
        }
    }
}

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

bool check(const int* array);
int main(void) {
    int length[3];
    int n;
    
    cin >> n;
    
    for(int i = 0; i < n; ++i) {
        cin >> length[0] >> length[1] >> length[2];
        sort(length, length + 3);
        if(check(length)) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}

bool check(const int* array) {
    if(array[0] * array[0] + array[1] * array[1] == array[2] * array[2]) {
        return true;
    } else {
        return false;
    }
}

C++: #include<stdio.h>
int main(){
  int n,i,j;
  int data[3];
  scanf("%d",&n); 
  for(i=0;i<n;i++){
    scanf("%d %d %d",&data[0],&data[1],&data[2]);
    for(j=0;j<2;j++){
      if(data[j]>data[j+1]){
	int temp;
	temp=data[j];
	data[j]=data[j+1];
	data[j+1]=temp;
      }
    }
    if(data[0]*data[0]+data[1]*data[1]==data[2]*data[2]){
      printf("YES\n");
    } else{
      printf("NO\n");
    }
  }
  return(0);
}

C++: #include<stdio.h>

int main(){
	int N = 0 ,i,j,k,cheak = 0,tmp = 0;
	int tri[2];
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d %d %d",&tri[0],&tri[1],&tri[2]);
		for(j = 0;j <= 2;j++){
			for(k = j + 1;k <= 2;k++){
				tmp = tri[j];
				tri[j] = tri[k];
				tri[k] = tmp;
			}
		}
		if(tri[0] * tri[0] == tri[1] * tri[1] + tri[2] * tri[2]){printf("YES\n");}
		else{printf("NO\n");}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main ()
{
    int N;
    cin>>N;
    int a,b,c,t,m,x;
    for(int i=1; i<=N; i++){

        cin>>a>>b>>c;
         t=a*a+b*b+c*c;
         m=max(a*a,max(b*b,c*c));
         x=t-m;
        if(m==x){
                cout<<"YES";
        }
        else {
            cout<<"NO";
        }
        
            cout<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n,j=0;
  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;
  }
    }
  return 0;
}

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

bool IsRightTriangle(const int a, const int b, const int c)
{
	if(a <= b){
		if(b <= c){
			if(c*c == a*a + b*b){
				return true;
			}else{
				return false;
			}
		}else{
			if(b*b == c*c + a*a){
				return true;
			}else{
				return false;
			}
		}
	}else{
		if(a <= c){
			if(c*c == a*a + b*b){
				return true;
			}else{
				return false;
			}
		}else{
			if(a*a == b*b + c*c){
				return true;
			}else{
				return false;
			}
		}
	}
}

int main()
{
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		int a, b, c;
		cin >> a >> b >> c;
		if(IsRightTriangle(a, b, c)){
			cout << "YES" << endl;
		}else{
			cout << "NO"  << endl;
		}
	}
	return 0;
}

C++: #include <cstdio>

using namespace std;

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

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

#define Triangle(s1,s2,s3) if(s1*s1+s2*s2==s3*s3)
using namespace std;

int main()
{
	int n;
	int h[3];
	vector<int> side;
	int i;
	
	cin >> n;
	
	for(i=0;i<n;i++)
	{
		side.clear();
		
//		vector<int>::iterator it=side.begin();
		
		for(int j=0;j<3;j++)
		{
			cin >> h[j];
			side.push_back(h[j]);
//			cout << "side: " << side[j] << endl;
		}
		
		sort(side.begin(),side.end());
		
//		it=side.begin();
		
//		cout << endl;
		
//		for(;it!=side.end();it++)
//			cout << *it << " " ;
		
//		cout << endl;
		
//		cout << "side1:" << side[0]*side[0] << " side2:" << side[1]*side[1] << " side3:" << side[2]*side[2] << endl;
		
		Triangle(side[0],side[1],side[2])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

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

int max(int *a);

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

C++: #include<iostream>


using namespace std;

int main(void)
{
int n,a = 0,b = 0,c = 0;
cin>>n;

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

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

}

return 0;
}

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

int main()
{
	int n;
	
	std::cin >> n;
	std::vector<std::string>answer;
	for(int i = 0;i < n;i++)
	{
		std::vector<int>length(3);
		for(int i = 0;i < 3;i++)
		{
			std::cin >> length[i]; 
		}
		std::sort(length.begin(),length.end());
		if((length[0]*length[0]) + (length[1]*length[1]) == (length[2]*length[2]))
		{
			answer.push_back("YES");
		}
		else
		{
			answer.push_back("NO");	
		}
	}

	for(int i = 0;i < n;i++)
	{
		std::cout << answer[i] << std::endl;
	}

	return 0;
}