Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	nQueries := nextInt()
	for i := 0; i < nQueries; i++ {
		lengths := []int{nextInt(), nextInt(), nextInt()}
		sort.Slice(lengths, func(i, j int) bool { return lengths[i] > lengths[j] })
		if math.Pow(float64(lengths[0]), 2) == math.Pow(float64(lengths[1]), 2)+math.Pow(float64(lengths[2]), 2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include<iostream>

using namespace std;

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

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

using namespace std;

int N;
int a,b,c;

int main(){
	cin >> N;

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

		if((a^2)+(b^2) == (c^2)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}

    return 0;
}

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<stdio.h>

int main(void){
    int n1, n2, n3, m;
    scanf("%d\n",&m);
    for(i = 0;i < m;i++) {
        scanf("%d %d %d",&n1,&n2,&n3);
        if(n1 * n1 + n2 * n2 = n3 * n3)
            printf("YES");
        else
            printf("NO");
        }
    return 0;
}

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

using namespace std;

int main() {
  int ct = 0;
  int a[3];

  scanf("%d", &ct);
  for(int i = 0; i < ct; i++) {
    scanf("%d %d %d", &a[0], &a[1], &a[2]);
    sort(a, a + 3);
    printf("%s\n", a[2] * a[2] == a[0] * a[0] + a[1] * a[1] ? "YES" : "NO");
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n][3];
for(int i=0; i<=n; i++){
for(int j=0; j<=3; j++){
cin >>a[n][j];
}}
for(int i=0; i<=n; i++){
if(((a[i][1]+a[i][2])>=a[i][3]) || ((a[i][1]+a[i][3])>=a[i][2]) || ((a[i][2]+a[i][3])>=a[i][1])){cout << "YES" << endl;}
else{cout << "NO" << endl;}
}
}

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

using namespace std;

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

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

int main(void){
    int line_num, i;
    vector<int> arr;
    arr.resize(3);
    cin >> line_num;
    for(i = 0; i < line_num; i++){
        cin >> arr[0] >> arr[1] >> arr[2];
        sort(arr.begin(), arr.end());
        if(arr[0]*arr[0]+arr[1]*arr[1] == arr[2]*arr[2]){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

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

int main()
{
  int n;
  int side[3];
  cin >> n;

  for (int i = 1; i <= n; i++){

    for (int j = 0; j <= 2; j++){
      cin >> side[j];
    }
    for (int j = 0; j < 2; j++){
      if (side[j] >= side[j + 1]){
        int s = side[j + 1];
        side[j + 1] = side[j];
        side[j] = s;
      }
    }
    if ((side[2] * side[2]) == ((side[0] * side[0]) + (side[1] * side[1]))){
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  
  return 0;
}

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

using namespace std;

int compare(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(){
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        int arr[3];
        cin >> arr[0] >> arr[1] >> arr[2];
        sort(arr, arr + 3);

        if (pow(arr[0], 2) + pow(arr[1], 2) == pow(arr[2], 2))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }

    }


    return 0;
}

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

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

C++: #include <iostream>

using namespace std;

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

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
    int n,a,i[3],f[3];
    cin>>n;
    for(int l=0;l<n;l++){
        if(n>1000){
            break;
        }
        for(a=0;a<3;a++){
            cin>>i[a];
            if(i[a]<=0||i[a]>1000){
                break;
            }
            f[a]=i[a]^2;
        }
        sort(f,f+3);
        if(f[2]==f[0]+f[1]){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
}

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

using namespace std;

int main() {
    int i,j,n,a,b,c;

    cin >> n;

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

        if(a == sqrt(pow(b,2) + pow(c,2))){
            cout << "Yes" << endl;
        }

        else if(b == sqrt(pow(a,2) + pow(c,2))){
            cout << "Yes" << endl;
        }

        else if(c == sqrt(pow(a,2) + pow(b,2))){
            cout << "Yes" << endl;
        }

        else{
            cout << "No" << endl;
        }
    }

    return 0;
}

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

C++: #include<stdio.h>
int main(void)
{
	int n=0;
	int i=0;
	int a[1001]={0},b[1001]={0},c[1001]={0};
	int irekae=0;
	int irekae2=0;

	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		scanf("%d",&b[i]);
		if (a[i]>b[i])
		{
			irekae=a[i];
			a[i]=b[i];
			b[i]=irekae;
		}
		scanf("%d",&c[i]);
		if (a[i]>c[i])
		{
			irekae=a[i];
			irekae2=b[i];
			a[i]=c[i];
			b[i]=irekae;
			c[i]=irekae2;
		}
		if (c[i]*c[i]==a[i]*a[i]+b[i]*b[i])
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}


	return 0;
}