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>
#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 <string>
#include <vector>
#include <iostream>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <cmath>
#include<algorithm>
using namespace std;
int main()
{
    int x,a[3];
    cin>>x;
    for(int i=1;i<x+1;i++){
        cin>>a[0]>>a[1]>>a[2];
        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 <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define ALL(x) (x).begin(),(x).end()
template<typename T> bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;}
template<typename T> bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;}
typedef long long ll;

int N;

int main()
{
	scanf("%d",&N);
	FOR(i,0,N){
		int A [3];
		scanf("%d%d%d",&A [0],&A [1],&A [2]);
		sort(A,A + 3);
		if(A [0] * A [0] + A [1] * A [1] == A [2] * A [2]){
			printf("Yes\n");
		}
		else{
			printf("No\n");
		}
	}

	return 0;
}

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

int N;
int a[3]; 
int b,c,d;

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

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<bool> arr;
	for(int i=0;i<n;i++)
	{
		vector<int> cnt;
		int a,b,c;
		cin>>a>>b>>c;
		cnt.push_back(a);
		cnt.push_back(b);
		cnt.push_back(c);
		sort(cnt.begin(),cnt.end());
		if(sqrt(cnt[0]*cnt[0] + cnt[1]*cnt[1]) == cnt[2])
			arr.push_back(true);
		else
			arr.push_back(false);
	}
	for(int i=0;i<arr.size();i++)
	{
		if(arr[i] == true)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main()
{
	int N, s1, s2, s3;

	while(cin >> N)
	{
		while(N--)
		{
			cin >> s1 >> s2 >> s3;
			if(s1*s1 + s2*s2 == s3*s3 || s1*s1 + s3*s3 == s2*s2 || s3*s3 + s2*s2 == s1*s1)
				cout << "YES\n";
			else
				cout << "NO\n";
		}
	}
	return 0;
}

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

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

C++: // aoj-0003.cpp

#include <cstdio>

int main() {
	int i, j;
	int sets, x, y, z;

	// read numbers of data sets
	scanf("%d", &sets);
	
	// read data set
	for (i=0; i<sets; ++i) {
		scanf("%d %d %d", &x, &y, &z);
		if (((x * x) + (y * y)) == (z * z)) {
			puts("YES");
		} else {
			puts("No");
		}
	}
	
	return 0;
}

C++: #include<stdio.h>

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

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

using namespace std;

////Nayeem Shahriar Joy,Applied Physics &Electronic Engineering,University of Rajshahi.

int main()

{
    vector<int>p;
   int t,a,b,c,d;
   cin>>t;
   while(t--)
   {
       for(int i=0;i<3;i++){
       cin>>a;
       p.push_back(a);
       }
       sort(p.begin(),p.end());
       b=p[0]*p[0];
       c=p[1]*p[1];
       d=p[2]*p[2];
       if(b+c==d)
       {
           cout<<"YES"<<endl;
       }
       else{
        cout<<"NO"<<endl;
       }
       p.clear();
   }
   return 0;
}

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

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

  return 0;
}

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

bool is_triangle(std::istream& is)
{
	unsigned int length[3];

	is >> length[0] >> length[1] >> length[2];

	assert(!is.fail() && !is.bad());
	assert(length[0] <= 1000 && length[1] <= 1000 && length[2] <= 1000);

	std::sort(length, length + 3);

	return length[0] * length[0] + length[1] * length[1] == length[2] * length[2];
}


int main(void)
{
	int num_cases;

	std::cin >> num_cases;

	for (int i = 0; i < num_cases; i++) {
		std::cout << (is_triangle(std::cin) ? "YES\n" : "NO\n");
	}
	return 0;
}

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

C++: #include <stdio.h>

int main(int argc, char const *argv[])
{
	int a[3];
	int i, j,k, temp;
	int n;
	scanf("%d", &n);
	for(k=0;k<n;k++) {
		scanf("%d%d%d", &a[0], &a[1], &a[2]);
		for(i=2;i>0;i--) {
			for(j=i;j>1;j--) {
				if(a[j]<a[j-1]) {
					temp = a[j];
					a[j-1] = a[j];
					a[j] = temp;
				}
			}
		}
		if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]) {
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
int n,a,b,c;
scanf("%d",&n);
while(n--){
scanf("%d %d %d",&a,&b,&c);
if(a==b||b==c||c==a){
printf("NO\n");
}
else{
    if(a>b&&a>c){
    if(b*b+c*c>=a*a)
    printf("YES\n");
    else
    printf("NO\n");
    }
    else if(b>a&&b>c){
    if(a*a+c*c>=b*b)
    printf("YES\n");
    else
    printf("NO\n");
    }
    else if(c>a&&c>b){
    if(a*a+b*b>=c*c)
    printf("YES\n");
    else
    printf("NO\n");
    }

}



}
return 0;
}

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

int main(){
	int n, in[3];
	string res;
	cin >> n;
	for (int i = 0; i < n; ++i){
		res = "NO";
		for (int j = 0; j < 3; ++j)	cin >> in[j];
		for (int j = 0; j < 3; ++j){
			if (pow(in[j%3], 2) == pow(in[(j+1)%3], 2) + pow(in[(j+2)%3], 2)){
				res = "YES";
			}
		}
		cout << res << endl;
	}

	return 0;
}