Go: package main

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

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)
		fmt.Fprintln(out, checkTriangle(data))
	}
}

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
}

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

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

int main(){
	int abc[3], N;
	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> abc[0] >> abc[1] >> abc[2];
		while(!(((abc[0] >= 1)&&(abc[0] <= 1000))&&
				((abc[1] >= 1)&&(abc[1] <= 1000))&&
				((abc[2] >= 1)&&(abc[2] <= 1000)))){
			cout << "wrong value\n";
			cin >> abc[0] >> abc[1] >> abc[2];
		}
		sort(abc, abc+3);
		if((pow(abc[0], 2) + pow(abc[1], 2)) == pow(abc[2], 2)){
			cout << "YES\n";
		}else{
			cout << "NO\n";
		}
	}
    return 0;
}

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

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

C++: #include <stdio.h>

int main() {
    const char YES[] = "YES\n";
    const char NO[] = "NO\n";

    int times = 0;
    scanf("%d", &times);
    for (int i = 0; i < times; ++i) {
        int inputSide[3];
        scanf("%d %d %d", &inputSide[0], &inputSide[1], &inputSide[2]);
        {
            bool finished = false;
            while (!finished) {
                finished = true;

                for (int j = 0; j < 3 - 1; ++j) {
                        if (inputSide[j] < inputSide[j + 1]) {
                        int temp = inputSide[j + 1];
                        inputSide[j + 1] = inputSide[j];
                        inputSide[j] = temp;
                        finished = false;
                    }
                }
            }
        }

        printf(((((inputSide[2] * inputSide[2]) + (inputSide[1] * inputSide[1])) == (inputSide[0] * inputSide[0])) ? YES : NO));
    }

    return 0;
}

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

using namespace std;

int main()
{
int T;
scanf("%d",&T);
for(int t=0;t<T;t++){
int edge[3];
printf("%d %d %d",edge,edge+1,edge+2);
sort(edge,edge+3,greater<int>());
if(edge[0]*edge[0]==edge[1]*edge[1]+edge[2]*edge[2]){
printf("%s\n","YES");
}else{
printf("%s\n","NO");
}
}

return 0;
}

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

using namespace std;

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
 
#define MAX 1000
#define MIN 1
 
using namespace std;
 
bool right(int a,int b,int c) {
 if(((a * a) + (b * b)) == (c * c)) {
  return true;
 } else {
  return false;
 }
}

int main() {
 int i = 0,j;
 int n;
 int side[3];
 bool cnt = false;
 vector<string> judge;
 
 cin >> n;
 
 while(i < n) {
  cin >> side[0] >> side[1] >> side[2];
 
  for(j = 0;j < 3;++j) {
   if((side[j] < MIN) || (side[j] > MAX)) {
    cnt = true;
   }
  }
 
  if(cnt == true) continue; 
 
  sort(side, side + 3);
 
  if(right(side[0],side[1],side[2]) == true) {
   judge.push_back("YES");
  } else {
   judge.push_back("NO");
  }

  ++i;
 }
 
 for(i = 0;i < judge.size();++i) {
  cout << judge.at(i) << endl;
 }
 
 return 0;
}

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

int isRightTriangle(int a, int b, int c)
{
	int s[3] = {a, b, c};
	std::sort(s, s+3);
	return (s[0] > 0) && (s[2] * s[2] == s[0] * s[0] + s[1] * s[1]);
}

int main()
{
	int count = 0;
	std::cin >> count;
	for (int i = 0; i < count; ++i) {
		int a = 0, b = 0, c = 0;
		std::cin >> a >> b >> c;
		std::cout << (isRightTriangle(a,b,c) ? "YES" : "NO") << std::endl;
	}

	return 0;
}

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

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

void erabu(double* a, double* b,double* c) {
	if (*a > *b) {
		swap(*a, *b);
	}
	if (*b > *c) {
		swap(*b, *c);
	}
	if (*a > *b) {
		swap(*a, *b);
	}
}
int main() 
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		double a, b, c;
		cin >> a >> b >> c;
		erabu(&a, &b, &c);
		if (pow(c, 2) == pow(a, 2) + pow(b, 2)) {
			cout << "Yes" << endl;
		}
		else cout << "No" << endl;
	}

	return 0;
}

C++: class Tenmou{
public class HelloWorld {
    public static void main (String[] args) {

	int n;
	int a,b,c;
	int a[3];
	string str[];
	
	n = Integer.parseInt(br.readLine());
	str[]=new str[n];
	for(int i=0;i<n;i++){

	a = Integer.parseInt(br.readLine());
	b = Integer.parseInt(br.readLine());
	c = Integer.parseInt(br.readLine());

	a[0]=max(a,b,c);
	if(a[0]==a){
		a[1]=b;
		a[2]=c;
	}elseif(a[0]==b){
		a[1]=a;
		a[2]=c;
	}elseif(a[0]==c){
		a[1]=b;
		a[2]=a;
	}
	if(a[0]^2==a[1]^2+a[2]^2){
		str[i]="YES";
	}else{
		str[i]="NO";
	}
	}

	for(int i=0;i<n;i++){
				System.out.println(str[i]);
	}
    }
}
}

C++: #include <iostream>


bool isTriangle(int a, int b, int c) {
  int a2 = a*a, b2 = b*b, c2=c*c;
  int sum = a2 + b2 + c2;
  if ((sum - 2 * std::max(std::max(a2, b2), c2)) == 0)
    return true;
  else
    return false;
}


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

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

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


}
return 0;
}

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



//int main(){
// int a[10];
// for(int i=0;i<10;i++){
//  cin>>a[i];
// }
// sort(a,a+10);
// for(int i=9;i>6;i--)
//  cout<<a[i]<<endl;
//return 0;
//}


//int main(){
//	int a,b,ans;
//	while(cin>>a>>b){
//		a+=b;
//		ans=1;
//		while(a/10){
//			a/=10;
//			ans++;
//			}
//		cout<<ans<<endl;
//	}
//	return 0;
//}

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])?"NO":"YES")<<endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
#include <queue>
#include <vector>
using namespace std;

int main()
{
	double a,b,c;
	int n,i;
	priority_queue< double, vector<double>, greater<double> > que;

	scanf("%d",&n);

	for(i = 0; i < n; i++){
		scanf("%lf %lf %lf",&a,&b,&c);
		que.push(a);
		que.push(b);
		que.push(c);
		a = que.top();
		que.pop();
		b = que.top();
		que.pop();
		if(pow( que.top(),2.0 ) == pow( a,2.0 ) + pow( b,2.0 )){
			printf("YES\n");
		}
		else{
			//printf("%lf %lf\n",pow( que.top(),2.0 ),pow( a,2.0 ) + pow( b,2.0 ));
			printf("NO\n");
		}
		que.pop();
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b,c;
    cin >> n;
    while(n--){
        cin >> a >> b >> c;
        if(a<b) swap(a,b);
        if(a<c) swap(a,c);
        if((a*a)==(b*b+c*c))    cout << "YES\n";
        else cout << "NO\n";
    }
}