Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	n, err := strconv.Atoi(strScan())
	if err != nil {
		fmt.Println("数字を入力して下さい。")
	} else {
		var counter int = n
		var judgeArr []string
		scanner := bufio.NewScanner(os.Stdin)
		for scanner.Scan() {
			strArr := strings.Fields(scanner.Text())
			castNumArr := StringToInt(strArr)
			judgeArr = append(judgeArr, checkTriangle(castNumArr))
			counter--
			if counter == 0 {
				break
			}
		}
		for _, v := range judgeArr {
			fmt.Println(v)
		}
	}
}

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"
	} else {
		return "NO"
	}
}

func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

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

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

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


	return 0;
}

C++: // This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <stdio.h>

int main()
{
int n;
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
int a;
int b;
int c;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    
if(a*a+b*b==c*c){
    printf("YES\n");
}
else if(b*b+c*c==a*a){
    printf("YES\n");
}
else if(c*c+a*a==b*b){
    printf("YES\n");
}
else {
    printf("NO\n");
}
        
}
}
// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://msdn.microsoft.com/library/3bstk3k5.aspx
//   http://www.cplusplus.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   http://www.boost.org/doc/

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

int main(void)
{
    int n, a[3];
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        bool flag = false;
        scanf("%d %d %d", &a[0], &a[1], &a[2]);
        for (int j = 0; j < 3; ++j) {
            if (a[j] * a[j] == a[(j + 1) % 3] * a[(j + 1) % 3] + a[(j + 2) % 3] * a[(j + 2) % 3]) {
                flag = true;
            }
        }
        if (flag) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
int main(){
	vector<int> a(3);
	cin >> a[0];
	while(cin>>a[0]>>a[1]>>a[2]){
		sort(a.begin(),a.end());
		if(a[2]*a[2]==a[0]*a[0] + a[1]*a[1]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
}

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

using namespace std;

void bigger(int *x, int *y);

int main(void){
	int data;
	int n1, n2, n3;
	cin >> data;
	for(int i = 0; i < data; i++){
		scanf("%d %d %d", &n1, &n2, &n3);
		bigger(&n1, &n2);
		bigger(&n1, &n3);
		
		if(n1* n1 == n2*n2 + n3*n3)
		cout << "YES" << endl;
		else
		cout << "NO" << endl;
		
	}
	return 0;
}

void bigger(int *x, int *y){
	if(*y > *x){
		int type = *x;
		*x = *y;
		*y = type;
	}
}

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

int main()
{
        using namespace std;
        deque<int> edge;
        int iedge[3];
        int j;
        int a,b,c;

        cin >> j;

        for(int l=0;l<j;l++){
                for(int i=0;i<3;i++){
                        cin >> iedge[i];
                edge.push_back(iedge[i]);
                }

                sort(edge.begin(),edge.end());
                a = edge[0];
                b = edge[1];
                c = edge[2];
                if(c*c == (a*a+b*b))cout << "YES\n";
                else cout << "NO\n";

                edge.clear();

        }

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

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int a,b,c,i,n;
    cin>>i;
    for(n=0;n<i;n++){
        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 <stdio.h>

int main(void) {
	int a, b, c, i ,j;
	scanf("%d", &j);
	for(i= 1; i <= j ;i++){
		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){
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	
	return 0;
}

C++: #include<stdio.h>

int main(void){
	int kosu,a[5]={0},temp,right,temp2,left;

	scanf("%d",&kosu);

	for(temp=0;temp<kosu;temp++){
		scanf("%d %d %d",&a[0],&a[1],&a[2]);
		
		for(int i=0;i<3;i++){
			for(int j=0;j<3;j++){
				if(a[j]<a[j+1]){
					temp2=a[j];
					a[j]=a[j+1];
					a[j+1]=temp2;
				}
			}
		}
		right=(a[2])*(a[2])+(a[1])*(a[1]);
		
		left=(a[0])*(a[0]);
		
		if(left==right){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

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

int n;
int edge[3];

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

C++: #include <iostream>

using namespace std;

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

C++: #include<stdio.h>

int main(){
  int N = 0 ,i,j,k,tmp = 0;
  int tri[3] = {0,0,0};
  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>
#include<algorithm>

using namespace std;

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

	cin >> n;
	while (n-- > 0) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		cout << (a[0] * a[0] + a[1] * a[1] == a[2] * a[2] ? "YES" : "NO") << endl;
	}

	return 0;
}

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

using namespace std;

int main(){
    int a[3];
    int N; cin >> N;
    while(N--){
        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;
    }
}