Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func main() {
	scanner.Split(bufio.ScanWords)
	n := nextInt()
	for i := 0; i < n; i++ {
		a := nextInt()
		b := nextInt()
		c := nextInt()
		if a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
		continue
	}
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <queue>
#include <vector>

#define pb push_back

using namespace std;

typedef long long ll;

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

        return 0;
}

C++: #include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <list>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <bitset>
#include <functional>

using namespace std;

#define FOR(i,n) 		for(int(i)=0;(i)<(int)(n);(i)++)
#define FORN(i,a,b,c) 	for(int(i)=a;i<(int)(b);i+=(c))
#define RES(x,nilai)	memset(x,nilai,sizeof(x));
#define pb              push_back
#define mp              make_pair
#define INF				1000000000

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

inline string IS(int a){
    char x[100];
    sprintf(x,"%d",a); string s = x;
    return s;
}

inline int SI(string a){
    char x[100]; int res;
    strcpy(x,a.c_str()); sscanf(x,"%d",&res);
    return res;
}

//==============================================

bool cmp(int x,int y) {return x>y;}

int arr[5],n;

int main() {
	//freopen("in.txt","r",stdin);
	//freopen("13.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	
	cin >> n;
	for(int i =0 ;i < n;i++) {
		cin >> arr[0] >> arr[1] >> arr[2];
		sort (arr,arr+3);
		if (sqrt((arr[0]*arr[0]) + (arr[1]*arr[1]) ) == arr[2]) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
		
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int sq(int x){return x*x;}
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<(sq(max(a,max(b,c)))*2==sq(a)+sq(b)+sq(c) ? "YES" :"NO")<<endl;
  }
  return 0;
}

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

int main() {

    int sankaku[3];
    
    while (1) {
    cin >> sankaku[0] >> sankaku[1] >> sankaku[2];
    sort (sankaku, sankaku + 3);
    
    if (sankaku[2] == (sankaku[0] * sankaku[0]) + (sankaku[1] * sankaku[1])) {
        cout << "YES" << endl;
    }else {
        cout << "NO" << endl;
    }
    }
    

    return 0;
}

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

int right_triangle(int a,int b,int c)
{
	if (   a == sqrt(pow(b,2)+pow(c,2)) 
	    || b == sqrt(pow(c,2)+pow(a,2))
	    || c == sqrt(pow(a,2)+pow(b,2)))
	    return 1;
	else
		return 0;
}

int main()
{
	int a[3],n;
	cin >> n;
	for(int j=0;j<=n-1;j++){
		for(int i=0;i<=2;i++)
			cin >> a[i];
		switch (right_triangle(a[0],a[1],a[2]))
		{
		case 0:
			cout << "NO" << endl;
			break;
		case 1:
			cout << "YES" << endl;
			break;
		default:
			cout << "error" << endl;
			break;
		}
	}
	return 0;
}

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

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

	return 0;
}

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

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

C++: i;main(a,b,c){for(scanf("%*d"),i=4;i--&&~scanf("%d%d%d",&a,&b,&c);puts((a+b-c&&b+c-a&&a+c-b)?"NO":"YES"))a*=a,b*=b,c*=c;exit(0);}

C++: #include<iostream>
using namespace std;
int main() {
	int x[3][1000];
	int z[1000];
	int a,b,c;
	cin >> b;
	for(a=0;a<b;a++) {
		for(c=0;c<3;c++) {
			cin >> x[c][a];
		}
	}
	for(a=0;a<b;a++){
		if(x[1][a]/3 == x[2][a]/4 && x[2][a]/4 == x[3][a]/5 || x[2][a]/5 == x[3][a]/4){
			cout << "YES" << endl;
		}
		else if(x[1][a]/4 == x[2][a]/3 && x[2][a]/3 == x[3][a]/5 || x[2][a]/5 == x[3][a]/3){
			cout << "YES" << endl;
		}
		else if(x[1][a]/5 == x[2][a]/3 && x[2][a]/3 == x[3][a]/4 || x[2][a]/4 == x[3][a]/3){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

void reOrder(int &a,int &b,int &c)
{
	int b1,b2,b3;
	b1 = a > b?(a > c? a:c):( b>c?b:c);
	b3 = a < b? (a < c? a:c):(b < c?b:c);
	b2 = a+b+c - b1 - b3;
	//
	a = b2;
	b = b3;
	c = b1;
}
int main(){

	int g,a,b,c;

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

	}

	
    return 0;
}

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

using namespace std;

int main()
{
	const int SIZE = 1000;
	int a[SIZE] ={};
	int b[SIZE] ={};
	int c[SIZE] ={};
	int num;
	cin >> num;
	for(int i = 0; i < num; i++)
		{
			cin >> a[i] >>b[i]>>c[i];
		}
	for(int i = 0; i < num; i++)
	{
		if(pow(a[i],2)==pow(b[i],2) + pow(c[i],2))
			cout << "YES"<< endl;
		else if(pow(b[i],2)==pow(c[i],2) + pow(a[i],2))
			cout << "YES"<< endl;
		else if(pow(c[i],2)==pow(a[i],2) + pow(b[i],2))
			cout << "YES"<< endl;
		else{cout << "NO" <<endl;}
	}
}

C++: #include<algorithm>
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;++i){
        int a[3];
        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\n";
        else cout<<"NO\n";
    }
}

C++: #include<iostream>

using namespace std;

int main(){
	
	int n;
	int x, y, z;
	
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> x >> y >> z;
		if(x > y && x > z){
			if((x * x) == ((y * y) + (z * z))){
				cout << "yes" << endl;
			}else{
				cout << "no" << endl;
			}
		}else if(y > x && y > z){
			if((y * y) == ((x * x) + (z * z))){
				cout << "yes" << endl;
			}else{
				cout << "no" << endl;
			}
		}else {
			if((z * z) == ((x * x) + (y * y))){
				cout << "yes" << endl;
			}else{
				cout << "no" << endl;
			}
		}
		
	}
	
	return 0;
}

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

void swap(int& a, int& b)
{
  int tmp = a;
  a = b;
  b = tmp;
}

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

    if(a * a + b * b == c * c)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

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