Go: // 九九を出すだけ
package main
import (
	"fmt"
	"os"
	"bufio"
	"strconv"
	"sort"
)

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)
	    sort.Ints(data)
	    if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
	        fmt.Fprintln(out, "YES")
	    }else{
	        fmt.Fprintln(out, "NO")
	    }
	}
}

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
}

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

int ary[3][1010];
int main(){
	priority_queue<int> que;
	int N;
	cin>>N;
	int a;
	for(int i=1;i<=N;i++){
		for(int j=0;j<=2;j++){
			cin>>a;
			que.push(a);
		}
		for(int j=0;j<=2;j++){
			ary[i][j]=que.top();
			que.pop();
		}
	}
	for(int i=1;i<=N;i++){
		if(ary[i][0]*ary[i][0]==ary[i][1]*ary[i][1]+ary[i][2]*ary[i][2]){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

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

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

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

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

int main () {
    int n, a,b,c,i;
    for(i=0;i<n;i++){
        cin >> a >> b >> c;
        if(hypot(a,b)==c||hypot(b,c)==a||hypot(a,c) == b) cout << "Yes" << endl;
        else cout << " No" << endl;
    }
}

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

C++: #include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
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*a+b*b==c*c||a*a==b*b+c*c||a*a+c*c==b*b)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

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

int N ;
int a,b,c,x,y,z ;

int main()
{
	cin >> N ;

	while( N > 0 )
	{
		cin >> a >> b >> c ;

		x = max( a, max( b, c ) ) ;
		y = min( a, max( b, c ) ) ;
		z = min( a, min( b, c ) ) ;

		if( (x*x) == ((y*y) + (z*z) ) )
		{
			cout << "YES" << endl ;
		}
		else
		{
			cout << "NO" << endl ;
		}

		N -- ;
	}

	_getch() ;
	return 0 ;
}

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

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

C++: import Control.Applicative
import Control.Monad
import Data.List

main = do
    n <- read<$>getLine
    tris <- map (map read.words)<$>replicateM n getLine
    mapM_ (putStrLn.yesOrNo.isRightTriangle) tris

isRightTriangle list = x^2 + y^2 == z^2
    where [x,y,z] = sort list

yesOrNo x = if x then "YES" else "NO"

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

using namespace std;

int main(){
  int sum, ans, a, b, c, a2, b2, c2;
  while(cin>>a>>b>>c){
    a2= sqrt(a);
    b2= sqrt(b);
    c2= sqrt(c);

    if((a2+b2==c2)||(b2+c2==a2)||(a2+c2==b2)){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()

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

C++: #include<stdio.h>
int main(void)
{
	int N=0;
	int a=0,b=0,c=0;
	int soto=0;
	int i=0;
	int wa=0;
	scanf("%d",&N);
	for (i=1;i<=N;i++)
	{
		scanf("%d %d %d",&a,&b,&c);
		if (a<b)
		{
			soto=a;
			a=b;
			b=soto;
		}
		if (a<c)
		{
			soto=a;
			a=c;
			c=soto;
		}
		wa=b*b+c*c;
		if (a*a==wa)
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
	return 0;
}

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

#define add push_back
#define inf 2147000000

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(void){
	double a,b,c,d,e,f,g,h,i,x,y;
	
	while(scanf("%lf",&a)!=EOF){
		scanf("%lf%lf%lf%lf%lf",&b,&c,&d,&e,&f);
		
		
		g=a/d;
		d*=g;
		e*=g;
		f*=g;
		
		h=b-e;
		i=c-f;
		
		x=i/h;
		h=a;
		i=c-b*x;
		y=i/h;
		
		printf("%.3lf %.3lf\n",y,x);
	}
}

C++: #include<iostream>

using namespace std;

int main(void){
  int n,a,b,c;

  cin >> n;
  while(n--){
    cin >> 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<stdio.h>
int main(void)
{
	int a,s,d,f,i,z;
	scanf("%d",&a);
	for(i=1;i<=a;i++){
	z=0;
	scanf("%d %d %d",&s,&d,&f);
		if(s<f&&d<f){
			if(s*s+d*d==f*f){
				z=1;
				printf("YES\n");
			}
		}
		else if(s<d&&f<d){
			if(s*s+f*f==d*d){
				z=1;
				printf("YES\n");
			}
		}
		else if(f<s&&d<s){
			if(d*d+f*f==s*s){
				z=1;
				printf("YES\n");
			}
		}
		if(z==0){
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include<algorithm>

int main(){
	int n,a,b,c;
	
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a[3];
		for(int j=0;j<3;j++)scanf("%d",&a[j]);
		std::sort(a,a+3);
		
		if(a[0]==3 && a[1]==4 && a[2]==5)puts("YES");else
		if(a[0]*a[1] == a[2]*a[2])puts("YES");
		else puts("NO");
	}
}

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

int main()
{
	int i,b,c,d;
	vector< int > a;

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

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

using namespace std;

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

	if (edges[0]*edges[0] + edges[1]*edges[1] == edges[2]*edges[2])
		cout << "YES" << endl;
	else 
		cout << "NO" << endl;
	}

	return 0;
}

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

using namespace std;

int main()
{
    int N;
    cin >> N;

    for (int i = 0; i < N; i++)
    {
        double a, b, c, l;
        cin >> a >> b >> c;
        if (max({a, b, c}) == c)
        {
            if (a * a + b * b == c * c)
                cout << "YES" << endl;
            else
                cout << "NO" << endl;
        }
        else if (max({a, b, c}) == b)
        {
            if (a * a + c * c == b * b)
                cout << "YES" << endl;
            else
                cout << "NO" << endl;
        }
        else if (max({a, b, c}) == a)
        {
            if (c * c + b * b == a * a)
                cout << "YES" << endl;
            else
                cout << "NO" << endl;
        }
        else
            cout << "NO" << endl;
    }
    return 0;
}