Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	nQueries := nextInt()
	for i := 0; i < nQueries; i++ {
		lengths := []int{nextInt(), nextInt(), nextInt()}
		sort.Slice(lengths, func(i, j int) bool { return lengths[i] > lengths[j] })
		if math.Pow(float64(lengths[0]), 2) == math.Pow(float64(lengths[1]), 2)+math.Pow(float64(lengths[2]), 2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <iostream>

using namespace std;

int main() {

	int dataNum;
	int hen[1000][3];

	cin >> dataNum;
	for (int i = 0; i < dataNum; i++) {
		cin >> hen[i][0] >> hen[i][1] >> hen[i][2];
	}

	for (int i = 0; i < dataNum; i++) {
		//cout << "for i datanum=" <<dataNum << endl;
		//????????????????????§?????????
		for (int j = 3 - 1; j >0; j--) {
			//cout << "for j" << endl;
			for (int k = 0; k < j; k++) {
				//cout << hen[i][k] << "," << hen[i][k + 1] << endl;
				if (hen[i][k] > hen[i][k + 1]) {
					//cout << "swap" <<endl;
					int dummy = hen[i][k];
					hen[i][k] = hen[i][k + 1];
					hen[i][k + 1] = dummy;
				}
			}
		}

		//??´?§?????????§??????
		if (hen[i][0] * hen[i][0] + hen[i][1] * hen[i][1] == hen[i][2] * hen[i][2]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO"  << endl;
		}
	}

	return 0;
}

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

int Max(int i[3]){
	int max=0,pos;
	for(int n=0;n<3;n++){
		if(max<i[n]){
			max=i[n];
			pos=n;
		}
	}
	return pos;

}

int main(){
	int N;
	cin >> N;
	while(N--){
		int i[3],c;
		int max;
		cin >> i[0] >> i[1] >> i[2];
		max = Max(i);
		c = i[max];
		i[max]=0;
		if(i[0]*i[0]+i[1]*i[1]+i[2]*i[2] == c*c)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}
}

C++: /*
AIZU ONLINE 0003

Is it a Right Triangle?
*/

#include <stdio.h>

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

	scanf("%d",&cnt);
	for(i=0;i<cnt;i++)
	{	scanf("%d %d %d",&a,&b,&c);


		if(a*a == b*b + c*c ||
           	   b*b == c*c + a*a ||
                   c*c == a*a + b*b)
			printf("YES\n");
		else
			printf("NO\n");

	}
	return(0);
}

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

C++: #include <cstdio>
#include <algorithm>
#define LOOP(index,times) for(int index=0;index<times;index++)
using namespace std;

int main(){

int N;
scanf("%d",&N);

int l[3];

LOOP(i,N){

scanf("%d %d %d",&l[0],&l[1],&l[2]);
sort(l,l+3);

if(l[0]*l[0]+l[1]*l[1]==l[2]*l[2])
	printf("YES\n");
else
	printf("NO\n");		

}
return 0;		
}

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

C++: #include<stdio.h>
int main(){int n,a,b,c;scanf("%d",&n);while(n--){scanf("%d %d %d",&a,&b,&c);a*=a;b*=b;c*=c;printf("%s\n",a+b==c||b+c==a||c+a==b?"YES":"NO");}return 0;}

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

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

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

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

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

int main(){

	int input[1000][3], num, i, j, temp;
	
	cin >> num;
	
	for(i = 0; i < num; i++){
	
		cin >> input[i][0] >> input[i][1] >> input[i][2];
		
		if(input[i][0] < input[i][1]){
			temp = input[i][0];
			input[i][0] = input[i][1];
			input[i][1] = temp;
			}

		if(input[i][0] < input[i][2]){
			temp = input[i][0];
			input[i][0] = input[i][2];
			input[i][2] = temp;
			}
		
		if(input[i][0] * input[i][0] == input[i][1] * input[i][1] + input[i][2] * input[i][2])
			cout << "YES" << endl;
		
		else cout << "NO" << endl;
	}
	
	return 0;
}

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

int main() {
  int n;
  cin >> n;
  for(int i=0; i<n; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    if (x*x+y*y == z*z || x*x+z*z==y*y || y*y+z*z==x*x)
      cout << "YES"<<endl;
    else
      cout << "NO" << endl;
  }
}

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

int main()
{
    int a,b,c,n,i;
    scanf("%d",&n);
    i=0;
    while(i<n)
    {
        scanf("%d %d %d",&a,&b,&c);
        if(a*a+b*b==c*c)
            printf("YES\n");
        else if(a*a+c*c==b*b)
            printf("YES");
        else if(b*b+c*c==a*a)
            printf("YES");
        else
            printf("NO\n");
            i++;
    }
    return 0;
}

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

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

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

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

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

using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		int e[3];
		for (int j = 0; j < 3; ++j)
			scanf("%d", e+j);
		sort(e, e+3);

		if (e[0]*e[0]+e[1]*e[1] == e[2]*e[2])
			puts("YES");
		else
			puts("NO");
	}

	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

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