Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

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();
    }
}

C++: 
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

int main() {
	double a, b, c;
	while (cin >> a >> b >> c) {
		if (pow(max(a, max(b, c)), 2) == pow(min(a, min(b, c)), 2) + pow(max(a, min(b, c)), 2)) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" <<endl;
		}
	}
	return 0;
}

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

using namespace std;


int main(){
    int input[3];
    int N;
    string *str;
    
    cin >> N;
    
    str=new string[N];
    
    for(int i=0;i<N;i++){
        cin>>input[1]>>input[2]>>input[3];
        sort(input,input+3);
        if(input[1]==sqrt((pow((double)input[2],(double)2)+pow((double)input[3],(double)2)))) str[i]="YES";
        else str[i]="NO";
    }
    
    for(int i=0;i<N;i++) cout<<str[i]<<endl;
    
    delete[] str;
    
    return 0;

}

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

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

  int i, n, a, b, c;
  vector<int> triangle;
  cin >> n;

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

    sort(triangle.begin(), triangle.end());
    if (triangle.at(0) * triangle.at(0) + triangle.at(1) * triangle.at(1) == triangle.at(2) * triangle.at(2)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }

    triangle.clear();
  }

  return 0;
}