Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

C++: #include<iostream>
#include<algorithm>
#include<math.h>

using namespace std;

int compare(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(){
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        int arr[3];
        cin >> arr[0] >> arr[1] >> arr[2];
        sort(arr, arr + 3);

        if (pow(arr[0], 2) + pow(arr[1], 2) == pow(arr[2], 2))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }

    }


    return 0;
}

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

using namespace std;
int n,a,b,c;
int main(){
	cin>>n;
	for(int i=0;i<n;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){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
  return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
    int n,a,i[3],f[3];
    cin>>n;
    for(int l=0;l<n;l++){
        if(n>1000){
            break;
        }
        for(a=0;a<3;a++){
            cin>>i[a];
            if(i[a]<=0||i[a]>1000){
                break;
            }
            f[a]=i[a]^2;
        }
        sort(f,f+3);
        if(f[2]==f[0]+f[1]){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
}

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

using namespace std;

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

    cin >> n;

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

        if(a == sqrt(pow(b,2) + pow(c,2))){
            cout << "Yes" << endl;
        }

        else if(b == sqrt(pow(a,2) + pow(c,2))){
            cout << "Yes" << endl;
        }

        else if(c == sqrt(pow(a,2) + pow(b,2))){
            cout << "Yes" << endl;
        }

        else{
            cout << "No" << endl;
        }
    }

    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int x,y,n, i, j,a[1000],b[1000],c[1000];
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a[i] >> b[i] >> c[i];
	}
	for (j = 0; j < n; j++) {
		x = a[j] * a[j] + b[j] * b[j];
		y = c[j] * c[j];
		if (x == y) {
			cout << "Yes"<<endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n=0;
	int i=0;
	int a[1001]={0},b[1001]={0},c[1001]={0};
	int irekae=0;
	int irekae2=0;

	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		scanf("%d",&b[i]);
		if (a[i]>b[i])
		{
			irekae=a[i];
			a[i]=b[i];
			b[i]=irekae;
		}
		scanf("%d",&c[i]);
		if (a[i]>c[i])
		{
			irekae=a[i];
			irekae2=b[i];
			a[i]=c[i];
			b[i]=irekae;
			c[i]=irekae2;
		}
		if (c[i]*c[i]==a[i]*a[i]+b[i]*b[i])
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}


	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int number;
    int hen[3];
    int temp;
    cin >> number;
    char *judge[200];
    
    REP(i,number)
    {
        REP(i, 3)
        cin >> hen[i];
        REP(i, 2)
        REP(j, 2)
        {
            if(hen[j] < hen[j+1])
            {
                temp = hen[j+1];
                hen[j+1] = hen[j];
                hen[j] = temp;
            }
        }
        if(hen[0]*hen[0] == (hen[1]*hen[1] + hen[2]*hen[2]))
            judge[i] = "YES";
        else
            judge[i] = "NO";
        
    }
    REP(i, number)
    cout << judge[i] << endl;
    
    return 0;
}

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

int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    std::cin >> n;
    for(int i=0; i<n; ++i){
        std::vector<int> e(3);
        for(auto& j : e){
            std::cin >> j;
        }
        std::sort(e.begin(), e.end());
        std::cout << ((e[0]*e[0]+e[1]*e[1]==e[2]*e[2])?"YES":"NO") << "\n";
    }
    return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int N;
double a, b, c;

void rep(double* x,double* y){
	double d;
	d = *x;
	*x = *y;
	*y = d;
}

int main(){
	
	cin >> N;
	for(int i = 0; i < N; ++i){
		cin >> a >> b >> c;
		
		if(a < b || a < c){
			if(b < c){
				rep(&a, &c);
			}else{
				rep(&a, &b);
			}
		}

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


	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>	/* ???????????????!! */



int main()
{
    int inputLineSize;
	int i;
	int input_X;
	int input_Y;
	int input_Z;
	int x[1000];
	int y[1000];
	int z[1000];

	scanf("%d", &inputLineSize);
	if(inputLineSize>1000) {
		return 0;
	}
	for(i=0; i < inputLineSize; i++) {
		scanf("%d%d%d", &input_X,&input_Y,&input_Z);
		x[i] = input_X;
		y[i] = input_Y;
		z[i] = input_Z;
	}
	
	for(i=0; i < inputLineSize; i++) {
		if( x[i] > 0 && y[i] > 0 && z[i] > 0) {
			if(pow(x[i],2) + pow(y[i],2) == pow(z[i],2) ) {
        		printf("YES\n");
			} else {
        		printf("NO\n");
			}
		} else {
        	printf("NO\n");
		}
	}

    return 0;
}

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

using namespace std;

int convertToInt(const string& str){
    stringstream ss;
    ss << str;

    int ret;
    ss >> ret;

    return ret;
}

void convertToIntVec(const string& str, vector<int>& ret){
    stringstream ss;
    ss << str;

    int a, b, c;
    ss >> a >> b >> c;

    ret.resize(3);
    ret[0] = a; ret[1] = b; ret[2] = c;
}



void readData(vector<string>& input_data){
    string buff;
    getline(cin, buff);

    int lines = convertToInt(buff);

    for(int i = 0; i < lines; ++i){
        getline(cin, buff);
        input_data.push_back(buff);
    }
}

bool isRightTriangle(vector<int>& edge){
    sort(edge.begin(), edge.end(), [](int a, int b)->bool{ return a < b; });
    return (edge[0]*edge[0] + edge[1] * edge[1] == edge[2] * edge[2]);
}


void mainRoutine(){
    vector<string> input_data;

    readData(input_data);

    for(int i = 0; i < input_data.size(); ++i){
        vector<int> edge;
        convertToIntVec(input_data[i], edge);
        cout << (isRightTriangle(edge) ? "YES" : "NO") << endl;
    }
}


int main(){
    mainRoutine();

    return 0;
}