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>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <cmath>
#include <stack>
#include <functional>
using namespace std;

 
int main()
{
  int n;
  cin >> n;
  vector<int> tri(3);

  while(n > 0, n--) {
    cin >> tri[0] >> tri[1] >> tri[2];
    sort(tri.begin(), tri.end());
    if(pow(tri[0], 2) + pow(tri[1], 2) == pow(tri[2], 2))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}

C++: #include <stdio.h>
#include <math.h>

int main(void) {
	int i,c,n,hen[3];
	double h,a;
	scanf("%d",&n);
	
	for(i = 0; n > i; i++){
		scanf("%d%d%d",&hen[0], &hen[1], &hen[2]);
		for(c = 0; 3 > c; c++){
		if(hen[c]*hen[c] + hen[(c+1)%3] * hen[(c+1)%3] == hen[(c+2)%3]*hen[(c+2)%3]) {printf("YES\n");break;}
		}
		if(3 == c)printf("NO\n");
	}
	return 0;
}

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

using namespace std;

int N;
int Side[3];

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

C++: #include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
using namespace std;
int stoi(string s)
{
    return atoi(s.c_str());
}
struct triangle
{
    triangle() { leg1 = leg2 = leg3 = 0; }
    bool isHyp()
    {
        if (leg1*leg1 + leg2*leg2 == leg3*leg3 || leg2*leg2 + leg3*leg3 == leg1*leg1 || leg3*leg3 + leg1*leg1 == leg2*leg2)
            return true;
        return false;
    }
    int leg1;
    int leg2;
    int leg3;
};
int main()
{
    int j;
    cin >> j;
    triangle* triData = new triangle[j];
    bool* results = new bool[j];
    string s;
    for (int i = 0; i < j; i++)
    {
        getline(cin, s, ' ');
        triData[i].leg1 = stoi(s);
        s.clear();
        getline(cin, s, ' ');
        triData[i].leg2 = stoi(s);
        s.clear();
        getline(cin, s);
        triData[i].leg3 = stoi(s);
        results[i] = triData[i].isHyp();
    }
    for (int i = 0; i < j; i++)
    {
        cout << (results[i] ? "YES" : "NO") << endl;
    }
    
    
    
    delete [] results;
    delete [] triData;
}

C++: #include<stdio.h>
int main(){
    int n;
    int a[3];
    int mem;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        mem=0;
        for(int j=0;j<3;j++){
            scanf("%d",&a[j]);
            if(mem<=a[j]){
                mem=a[j];
            }
        }
        if(mem*mem==a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-mem*mem){
            printf("YES\n");
        }
        else{
            printf("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;

		int max=a, k=b, l=c;
		if(max < b){
			max = b;
			k=a;
		}
		if(max < c){
			max = c;
			k=b;
			l=a;
		}

		if(max*max == k*k + l*l)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

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

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

bool is_right_triangle(int a, int b, int c){
  // a2 >= b2 >= c2
  int a2, b2, c2;
  
  if(a >= b && a >= c){
    a2 = a * a;
    
    if(b >= c){
      b2 = b * b;
      c2 = c * c;
    } else {
      b2 = c * c;
      c2 = b * b;
    }
  } else if(b >= a && b >= c){
    a2 = b * b;

    if(a >= c){
      b2 = a * a;
      c2 = c * c;
    } else {
      b2 = c * c;
      c2 = a * a;
    }
  } else if(c >= a && c >= b){
    a2 = c * c;

    if(a >= b){
      b2 = a * a;
      c2 = b * b;
    } else {
      b2 = b * b;
      c2 = a * a;
    }
  }

  cout << a2 << endl;
  cout << b2 << endl;
  cout << c2 << endl;

  return true;
}

int main(){
  int n;
  cin >> n;

  int a,b,c;

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

    if(is_right_triangle(a, b, c)) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  
  return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(void){
    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)))||((b*b)==((a*a)+(c*c)))||((c*c)==((a*a)+(b*b))))
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}

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

using namespace std;

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

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

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

int main(void)
{
    int n, a, b, c;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a >> b >> c;
        int min, mid, max;
        min = (a < b && a < c)? a : (b < a && b < c)? b : c;
        max = (a > b && a > c)? a : (b > a && b > c)? b : c;
        mid = (a!=min && a!=max)? a : (b!=min &&b!=max)? b : c;
        cout << min << " " << mid << " " << max << endl;
        cout << ((pow(min, 2.0) + pow(mid, 2.0) == pow(max, 2.0))? "YES" : "NO") << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[3],b[3],c,i[3],f[3],j,max,l,k,gou=0,gou2;
    float opi=4;
    cin>>n;
    n<=1000;
    for(l=0;l<n;l++){
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>=1000||a[k]<=0){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}

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

int main()
{
    int a,b,c,data=0;
    int d[3]={};
    
    cin >> data;
    
    for (int i=0; data>=i; i++) {

        cin >> d[0] >> d[1] >> d[2];
        
        sort(d,d+3);
        
        a=d[0];
        b=d[1];
        c=d[2];
        
        if (c*c == a*a+b*b) {
            cout << "YES";
        }else{
            cout << "NO";
        }
    }
}

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

int main(){
	int n, hen[3];

	cin >> n;

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