Go: package main
import (
    "fmt"
    "os"
    "bufio"
    "strconv"
    "sort"
)
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
func main(){
    sc.Split(bufio.ScanWords)
    defer out.Flush()
    n := nextInt()
    for i:=0; i<n; i++{
        data := nextInts(3)
        sort.Ints(data)
        if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
            fmt.Fprintln(out, "YES")
        }else{
            fmt.Fprintln(out, "NO")
        }
    }
}
 
func next() string{
    sc.Scan()
    return sc.Text()
}
 
func nextInt() int{
    a, _ := strconv.Atoi(next())
    return a
}
 
func nextInts(n int) []int{
    a := make([]int, n)
    for i:=0; i<n; i++{
        a[i] = nextInt()
    }
    return a
}

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

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

int main(void) {
    priority_queue<int, vector<int>, greater<int>> que;
    int num;
    cin >> num;
    for(int r = 0; r < num; r++) {
        int a, b, c;
        cin >> a >> b >> c;
        que.push(a); que.push(b); que.push(c);
        a = que.top(); que.pop(); b = que.top(); que.pop(); c = que.top(); que.pop();
        if(a * a + b * b == c * c) printf("YES\n");
        else printf("NO\n");
    }
    
    return(0);
}

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

C++: #include <iostream>
using namespace std;
#define max(x, y) ((x) > (y) ? (x) : (y))
#define min(x, y) ((x) < (y) ? (x) : (y))

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		int x, y, z;
		cin >> x >> y >> z;
		int ma = max(x, max(y, z));
		int mi = min(x, min(y, z));
		int cen = (ma != x && mi != x ? x : ma != y && mi != y ? y : z);
		if (ma * ma == mi * mi + cen * cen){
			cout << "YES" << "\n";
		}else{
			cout << "NO" << "\n";
		}
	}
	cout.flush();
}

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

int main(void){
	int N,a,b,c,d=0,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==b){
			d=d+((a*a)%1);
			d=d+((b*b)%1);
			d=d+((c*c)%2);
		}
		else{
			d=d+((a*a)%1);
			d=d+((b*b)%4);
			d=d+((c*c)%3);
		}
		
		if(d==0){
			cout<<"No"<<endl;
		}
		else{
			cout<<"Yes"<<endl;
		}
	}
		return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a[4] = { 0 }, j, b, cnt, i, n, A = 0, B = 0, c, ruio;
	scanf("%d", &n);
	for (ruio = 0; ruio < n; ruio++) {
		scanf("%d %d %d", &a[0], &a[1], &a[2]);
		for (i = 0; i < 3; i++) {
			for (j = i; j < 3; j++) {
				if (a[i] < a[j]) {
					c = a[i];
					a[i] = a[j];
					a[j] = c;
				}
			}
		}
		if (a[0] * a[0] == a[1] * a[1] + a[2] * a[2]) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	}

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

#define pb push_back
#define fr first
#define sc second
typedef pair<int,int> pii;
typedef vector<int> vi;
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

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

C++: #include<stdio.h>
int main(){
  int a,b,c;
  while(scanf("%d%d",&a,&b)!=EOF){
  	c = a + b;
  	if(c<10) printf("1\n");
  	else if(c<10^2) printf("2\n");
  	else if(c<10^3) printf("3\n");
  	else if(c<10^4) printf("4\n");
  	else if(c<10^5) printf("5\n");
  	else if(c<10^6) printf("6\n");
  	else if(c<10^7) printf("7\n");
  	else break;
  }
  return 0;
}

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

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

using namespace std;

long dd(int n){
	return n*n;
}

int main(){
	int n, t[3];
	
	cin >> n;
	for(int i=0; i<n; ++i){
		for(int j=0; j<3; ++j)
		scanf(" %d", &t[j]);
	 		
		sort(t, t+3);
		if( dd(t[2]) == dd(t[0])+dd(t[1]) ) printf("YES\n");
		else printf("NO\n");
	}
	 
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include<algorithm>
#define pf printf
#define sf scanf
#define wh while
#define db double
#define LL long long
#define _USE_MATH_DEFINES
#define re(i,a,b) for(int i=a;i<b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

int main()
{
    int t,a,b,c;
    cin>>t;
    wh(t--){
        sf("%d%d%d",&a,&b,&c);
        if((a*a==b*b+c*c)||(b*b==a*a+c*c)||(c*c==a*a+b*b))pf("YES\n");
        else pf("NO\n");
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
    int n;
    vector<int> a(3);
    cin>>n;
    for(int i=0;i<n;i++){
        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;
    }
    return 0;
}

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

C++: def main():
    def inputs():
        li = []
        count = 0
        try:
            N = input()
            while count < int(N):
                li.append(input())
                count += 1
        except EOFError:
            return li
        return li

    li = inputs()
    for x in li:
        tmp = x.split(" ")
        tmp = sorted(tmp)
        a,b,c = int(tmp[0]),int(tmp[1]),int(tmp[2])
        if c**2 == a**2 + b**2:
            print("YES")
        else:
            print("NO")
    return None

main()

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>





using namespace std;


int main()
{

	int count ;
	int a, b, c, maxs;

	cin >> count;

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

		maxs = max({ a, b, c });

		if (maxs == a)
		{
			if (maxs == sqrt(b * b + c * c))
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		else if (maxs == b)
		{
			if (maxs == sqrt(a * a + c * c))
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		else if(maxs == c)
		{
			if (maxs == sqrt(a * a + b * b))
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
	}


}

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

int main() {
    int n;
    scanf("%d", &n);
    
    std::multiset<int> ms;
    int a, b, c;
    for (int i = 0; i < n; ++i) {
        scanf("%d %d %d", &a, &b, &c);
        ms.insert(a);
        ms.insert(b);
        ms.insert(c);

        auto it = ms.begin();
        a = *it++;
        b = *it++;
        c = *it;
        
        printf(a*a + b*b == c*c ? "YES\n" : "NO\n");
        ms.clear();
    }
}