Go: package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := 0; i < n; i++ {
		sc.Scan()
		edges := make([]int, 3, 3)
		cols := sort.StringSlice(strings.Split(sc.Text(), " "))
		cols.Sort()
		for i, c := range cols {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;

#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))

using namespace std;
string is_valid_triangle(int a, int b, int c){
    string out = "NO";
    if (pow(a, 2) == pow(b,2) + pow(c,2) || pow(b, 2) == pow(a, 2) + pow(c, 2) || pow(c, 2) == pow(a, 2) + pow(b, 2)){
        out = "YES";
    }
    return out;
}
int main() {
    int l;
    cin >> l;
    REP(i, 0, l){
        int a, b, c;
        cin >> a >> b >> c;
        cout << is_valid_triangle(a, b, c) << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
using namespace std;
int main(){
    int n,a[3],b[3],l,k;
    cin>>n;
    for(l=0;l<n;l++){
        if(n>1000||n<=0){
            break;
        }
        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;
        }
    }
    return 0;
}

C++: #include <stdio.h>

void right_triangle (int x, int y, int z)
{
    if(x * x == y * y + z * z || y * y == z * z + x * x || z * z == x * x + y * y){
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

int main(void)
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i){
        int x, y, z;
        scanf("%d %d %d", &x, &y, &z);
        right_triangle(x, y, z);
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
        LL N;
        cin>>N;
        REP(i,N){
            vector<int>v;
            int a,b,c;
            cin>>a>>b>>c;
            v.push_back(a);
            v.push_back(b);
            v.push_back(c);
            sort(v.begin(),v.end());
            if(v[0]*v[0]+v[1]*v[1]==v[2]*v[2]){
               cout<<"YES"<<endl;
            }else{
               cout<<"NO"<<endl;
            }
        }
	return(0);
}

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

int main()
{
    int m,n,k,j,i,sum=0;
    while(cin>>j)
    {
       for(i=0;i<j;i++)
    {
    cin>>m>>n>>k;
    sum=sqrt((m*m)+(n*n));
    if(k==sum)
    {
        cout<<"YES"<<endl;
    }
    else
    cout<<"NO"<<endl;
    }

    }

return 0;
}

C++: #include <stdio.h>
 
using namespace std;
 
 
int main(){
    int n,a,b,c,A,B,C;
    scanf("%d",&n);
 
    for(int i=0;i<n;i++){
        scanf("%d %d %d",&a,&b,&c);
        A = a*a;
        B = b*b;
        C = c*c;
        if(A+B==C||B+C==A||C+A==B){
            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;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> a[j];
        }
        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<cstdio>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
  int n,j=0;
  int a[3];
  cin>>n;
  while(j<n){
    for(int i=0;i<3;i++){
      cin>>a[i];
    }
    sort(a,a+3);
    if(pow(a[2],2)==pow(a[1],2)+pow(a[0],2)){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  j++;
  }
  return 0;
}

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

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

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

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

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(a*a+b*b==c*c || b*b+c*c==a*a || c*c+a*a==b*b) cout << "YES" << endl;

    else cout << "NO" << endl;

  }

  return 0;

}

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

using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int N;
  cin >> N;
  for (int i = 0; i < N; i ++) {
    int a, b, c;
    cin >> a >> b >> c;
    int aa = a * a, bb = b * b, cc = c * c;
    if (aa + bb == cc || bb + cc == aa || cc + aa == bb) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}

C++: #include <iostream> 
#include <math.h> 
#include <iomanip> 
using namespace std;  
  
int main()  
{  
int num,a,b,c;
cin >> num;
for(int i=1;i<=num;i++)
{cin >> a >> b >> c;
if(a <= b && b <= c && a*a+b*b==c*c)
{cout << "YES" << endl;}
else if(a <= c && c <= b && a*a+c*c==b*b)
{cout << "YES" << endl;}
else if(b <= a && a <= c && a*a+b*b==c*c)
{cout << "YES" << endl;}
else if(c <= a && a <= b && a*a+c*c==b*b)
{cout << "YES" << endl;}
else if(b <= c && c <= a && b*b+c*c==a*a)
{cout << "YES" << endl;}
else if(c <= b && b <= a && b*b+c*c==a*a)
{cout << "YES" << endl;}
else
{cout << "NO" << endl;}
}
}

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

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

C++: #include <iostream>
using namespace std;
bool judge(int,int,int);

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

bool judge(int a, int b, int c){
    if (a > b && a > c && a * a == b * b + c * c){
        return true;
    }else if(b > a && b > c && b * b == c * c + a * a){
        return true;
    }else if(c > a && c > b && c * c == a * a + b * b){
        return true;
    }else{
        return false;
    }
}

C++: #include <stdio.h>

int main(void)
{
	int a,b,c,i,k;
	int sort[3];
	int num;
	int max,mid,min;
	int d=1,n=3;
	num<=1000;
	
	scanf("%d",&num);
	
	
    while(d<=num){
		scanf("%d %d %d",&sort[0],&sort[1],&sort[2]);
		for(n=3;n<=1;n--){
			for(i=0;i<=n-1;i++){
				if(sort[i]>sort[i+1]){
						k=sort[i];
						sort[i]=sort[i+1];
						sort[i+1]=k;
					}
			}
		}
		max=sort[2];
		mid=sort[1];
		min=sort[0];
		if(max*max==mid*mid+min*min){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
		d++;
	}
	return 0;
}