Go: package main

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

func main() {
	n, _ := strconv.Atoi(strScan())
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		scanner.Scan()
		strArr := strings.Fields(scanner.Text())
		castNumArr := StringToInt(strArr)
		fmt.Println(checkTriangle(castNumArr))
	}
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}

func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

C++: #include<iostream>
using namespace std;
int main(void) {
	int i=1, j, max, a[3],kaisu;
	cin >> kaisu;
	while (1) {
		cin >> a[0] >> a[1] >> a[2];
		if (a[0] >= a[1] && a[0] >= a[2]) {
			if (a[0] * a[0] == a[1] * a[1] + a[2] * a[2])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		else if (a[1] >= a[0] && a[1] >= a[2]) {
			if (a[1] * a[1] == a[2] * a[2] + a[0] * a[0])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		else
		{
			if (a[2] * a[2] == a[1] * a[1] + a[0] * a[0])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;

		}

		if (i == kaisu)break;
		i++;
	}
	return 0;
}

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

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

int main(){
  int n;
  int l[3];
  for(cin >> n;n>0;n--){
    cin>>l[0]>>l[1]>>l[2];
    sort(l,l+3);
    if (l[0]*l[0]+l[1]*l[1] == l[2]*l[2])
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <queue>
#include <vector>

using namespace std;

bool Check(int n,int m,int l){
	if(n == m && m == l && l == n){ return false; }
	priority_queue<int> q;
	q.push(n);
	q.push(m);
	q.push(l);
	int a,b,c;
	c = q.top();
	q.pop();
	b = q.top();
	q.pop();
	a = q.top();
	q.pop();
	if(a * a + b * b == c * c){
		return true;
	}else{
		return false;
	}
}

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

C++: #include <cstdio>
using namespace std;
int main(){
  int a,b,c,n;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    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\n");
    else if(b*b+c*c==a*a) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}

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

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	int n,i,w[1000],a[1000],s[1000],d[1000],x[1000];
	while(scanf("%d",&n)!=EOF){
		for(i=0;i<n;i++){
			scanf("%d %d %d",&a[i],&s[i],&d[i]);
			w[i]=(a[i]*a[i])+(s[i]*s[i]);
			x[i]=d[i]*d[i];
		}
		for(i=0;i<n;i++){
			if(w[i]==x[i]){
				printf("YES\n");
			}
			else{
				printf("NO\n");
			}
		}	
	}
	return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	auto N=in();
	REP(i,N){
		auto v=vecin(3);
		sort(ALL(v));
		if(v[0]*v[0]+v[1]*v[1]==v[2]*v[2]) out("YES");
		else out("NO");
	}
	return 0;
}

C++: #include<stdio.h>

int main()
{
	int input_num;
	scanf("%d", &input_num);
	while(0 < input_num--)
	{
		int sides[3];
		scanf("%d %d %d", &sides[0], &sides[1], &sides[2]);

		for(int i = 0; i < 2; i++)
		{
			if(sides[i] > sides[i+1])
			{
				int swap = sides[i];
				sides[i] = sides[i+1];
				sides[i+1] = swap;
 			}
		}
		printf("%s\n", (sides[0]*sides[0]+sides[1]*sides[1]==sides[2]*sides[2]) ? "YES" : "NO");
	}
	return 0;
}

C++: #include<iostream>
#include <cmath>
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>
#include <algorithm>

using namespace std;

int main () {
	int n;

	cin >> n;

	int henA, henB, henC;
	for (int i = 0; i < n; i++) {
		cin >> henA >> henB >> henC;

		if(henA > henC ) {			
			swap(henA, henC);
		}

		if(henB > henC ){
			swap(henB, henC);
	}

		if (henA * henA + henB * henB == henC * henC)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

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

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

C++: #include <iostream>

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

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