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++: import Control.Monad
import Data.List

main = do
  n <- readLn
  s <- map (map (read :: (String -> Int)) . words) <$> replicateM n getLine
  mapM_ putStrLn $ map (\x -> if x then "YES" else "NO") $ map (\x -> (x !! 2) ^ 2 == (x !! 0) ^ 2 + (x !! 1) ^ 2)  $ map (sort) s

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

using namespace std;

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

C++: #include<stdio.h>
int main(void)
{
	int n,i,w,a,s,d,x,j,z;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d %d %d",&a,&s,&d);
			if(a>s&&d<a){
				w=(d*d)+(s*s);
				x=a*a;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}	
			}	
			if(a<d&&d>s){
				w=(a*a)+(s*s);
				x=d*d;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}				
			}
			if(a<s&&s>d){
				w=(d*d)+(s*s);
				x=s*s;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}				
			}
			else if(a==s&&s==d&&d==a||a==s||s==d||d==a){
				printf("NO\n");
			}	
		
		}
	return 0;
}

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


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

      index = 0;  //????????????
      cin >> n;  //???????????°??????

      while(1)  //???????????????
      {
           cin >> a >> b >> c;       //?????????????????????

???????????????if( a*a + b*b == c*c)      //??????????????????
???                 cout >> "Yes" >> endl;
          else
                   cout >> "No" >> endl;
     
          if(index == n)
                   break;      //???????????±???

          index++;
     }

     return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream> 
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std; 
int main(){
	int a, b, c;
	while(a >> b >> c){
		if(a+b <= c || a+c <= b || b+c <= a){
			cout << "NO" << endl;
		}
		else{
			cout << "YES" << endl;
		}
	}
	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 "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	int N; cin >> N;
	while (N--) {
		int a, b, c; cin >> a >> b >> c;
		if (a > b)swap(a, b);
		if (b > c)swap(c, b);
		if (a*a + b*b ==c* c)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
  
using namespace std;
  
int main(void){
  int n,array[3],i;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d %d",&array[0],&array[1],&array[2]);
    sort(array,array+3);
    if(array[0]*array[0]+array[1]*array[1]==array[2]*array[2])  printf("Yes\n");
    else  printf("No\n");
  }
  
  return 0;
}

C++: #include <iostream>
#include <algorithm>
 
using namespace std;
 
int main(){
  int num,tmp;
 
  cin >> num;

  int a[num][3];

  for(int i=0; i<num; ++i)
    cin >> a[i][0] >> a[i][1] >> a[i][2];


  for(int i=0; i<num; ++i){

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

}

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

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

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

using namespace std;

static bool judge_rightTri(vector<int> &dataset) {

	sort(dataset.begin(), dataset.end());

	if ((pow(dataset.at(0), 2) + pow(dataset.at(1), 2)) == pow(dataset.at(2), 2)) {
		return true;
	}

	return false;
}

int main(void) {
	int input_num;
	cin >> input_num;

	vector<vector<int>> input(input_num, vector<int>(3, 0));

	for (vector<int> &dataset : input) {
		for (int &data : dataset) {
			cin >> data;
		}
	}

	for (vector<int> &dataset : input) {
		if (true == judge_rightTri(dataset)) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

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

#define times(n, i) uptil(0, n, i)
#define upto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi i <= _##i poi i++)
#define uptil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi i < _##i poi i++)
#define downto(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi i >= _##i poi i--)
#define downtil(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi i > _##i poi i--)

#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define poi ;
#define poipoi << "\n"

using namespace std;

bool pyon(int a, int b, int c){
    return c && a * a + b * b == c * c poi
}

int main(){
    int n poi
    cin >> n poi
    times(n, i){
        int a, b, c poi
        cin >> a >> b >> c poi
        if(pyon(a, b, c) || pyon(b, c, a) || pyon(c, a, b)) cout << "YES" poipoi poi
        else cout << "NO" poipoi poi
    }
    return 0 poi
}

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

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		int a, b, c;
		cin >> a >> b >> c;
		int x, y, z;
		x = max(a,max(b,c));
		y = min(a,min(b,c));
		z = (a+b+c) - x - y;
		
		if(x*x == y*y + z*z)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
      return 0;
}