Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <array>
#include <algorithm>
#include <functional>

using namespace std;


int main(void)
{
	int n;
	cin >> n;

	vector<bool> result(n);

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

		sort(begin(triangle), end(triangle), less<int>());

		const auto square = bind(pow<int, int>, placeholders::_1, 2);
		result[i] = 
			square(triangle[0]) == square(triangle[1]) + square(triangle[2]);
	}

	for(const bool& b : result){
		cout << (b ? "YES" : "NO") << endl;;
	}

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<numeric>
#include<vector>
#include<iostream>
#include<map>
#include<math.h>

using namespace::std;

int main(void)
{

  int n;
  cin >> n;

  while( n-- )
    {
      vector<double> edge(3);
      
      for(int i = 0; i < 3; i++)
	{
	  cin >> edge[i];
	}

      sort( edge.begin() , edge.end() );

      string ans = "YES";

      if( !( pow( edge[0] , 2 ) + pow( edge[1] , 2 ) == pow( edge[2] , 2 ) ) )
	{
	  ans = "NO";
	}

      cout << ans << endl;

    }

  return 0;

}

C++: #include <stdio.h>
#include <math.h>
int trianglechecker(int x, int y, int z);
int main(void){
    int loop,len1,len2,len3,Len1,Len2,Len3;
    int f=0;
    scanf("%d", &loop);
    for(int i=0;i<loop;i++)
    {
        scanf("%d%d%d", &len1, &len2, &len3);
        f=trianglechecker(len1,len2,len3);
        if(f == 1)
        {
            printf("YES\n");
        }
        if(f == 0)
        {
            printf("NO\n");
        }
    }
    return 0;
}
int trianglechecker(int x, int y, int z)
{
    if(x * x == y * y + z * z){
        return 1;
    }
    if(y * y == x * x + z * z){
        return 1;
    }
    if(z * z == y * y + x * x){
        return 1;
    }
    return 0;
}

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

using namespace std;

int maxnum(int f,int s,int t) {

   if (f >= s && f >= t) {

      return 0;

   }
   else if (s >= f && s >= t) {

      return 1;

   }
   else {

      return 2;

   }

}

bool solve() {

   int n;
   vector<int[3]> set;
   bool f;

   cin >> n;

   for (long i=0;i<n;i++){
   
      for (long j = 0; j < 3; j++) {

         cin >> set[i][j];

      }
   
   }

   for (long i = 0; i < n; i++) {

      f=( pow(set[i][0],2)==(pow(set[i][1],2)+pow(set[i][2],2)) || pow(set[i][1],2)==(pow(set[i][0],2)+pow(set[i][2],2)) || pow(set[i][2], 2) == (pow(set[i][0], 2) + pow(set[i][1], 2)) );
      f?cout << "YES\n" : cout << "NO\n";
   }

   return 0;
}

int main() {

   return solve();

}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <cmath>
#include <stack>
#include <functional>
using namespace std;

 
int main()
{
  int n;
  cin >> n;
  vector<int> tri(3);

  while(n > 0, n--) {
    cin >> tri[0] >> tri[1] >> tri[2];
    sort(tri.begin(), tri.end());
    if(pow(tri[0], 2) + pow(tri[1], 2) == pow(tri[2], 2))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}

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

int main(void) {
	int i,c,n,hen[3];
	double h,a;
	scanf("%d",&n);
	
	for(i = 0; n > i; i++){
		scanf("%d%d%d",&hen[0], &hen[1], &hen[2]);
		for(c = 0; 3 > c; c++){
		if(hen[c]*hen[c] + hen[(c+1)%3] * hen[(c+1)%3] == hen[(c+2)%3]*hen[(c+2)%3]) {printf("YES\n");break;}
		}
		if(3 == c)printf("NO\n");
	}
	return 0;
}

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

using namespace std;

int N;
int Side[3];

int main()
{
	scanf("%d",&N);
	for(int i= 0;i<N;i++)
	{
		for(int j=0;j<3;j++)
		{
			scanf("%d",&Side[j]);
		}
		sort(Side,Side+3);
		if(Side[0]*Side[0]==Side[1]*Side[1]+Side[2]*Side[2])printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
using namespace std;
int stoi(string s)
{
    return atoi(s.c_str());
}
struct triangle
{
    triangle() { leg1 = leg2 = leg3 = 0; }
    bool isHyp()
    {
        if (leg1*leg1 + leg2*leg2 == leg3*leg3 || leg2*leg2 + leg3*leg3 == leg1*leg1 || leg3*leg3 + leg1*leg1 == leg2*leg2)
            return true;
        return false;
    }
    int leg1;
    int leg2;
    int leg3;
};
int main()
{
    int j;
    cin >> j;
    triangle* triData = new triangle[j];
    bool* results = new bool[j];
    string s;
    for (int i = 0; i < j; i++)
    {
        getline(cin, s, ' ');
        triData[i].leg1 = stoi(s);
        s.clear();
        getline(cin, s, ' ');
        triData[i].leg2 = stoi(s);
        s.clear();
        getline(cin, s);
        triData[i].leg3 = stoi(s);
        results[i] = triData[i].isHyp();
    }
    for (int i = 0; i < j; i++)
    {
        cout << (results[i] ? "YES" : "NO") << endl;
    }
    
    
    
    delete [] results;
    delete [] triData;
}

C++: #include<stdio.h>
int main(){
    int n;
    int a[3];
    int mem;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        mem=0;
        for(int j=0;j<3;j++){
            scanf("%d",&a[j]);
            if(mem<=a[j]){
                mem=a[j];
            }
        }
        if(mem*mem==a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-mem*mem){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
    }
    return 0;
}

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

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

	cin >> n;

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

		int max=a, k=b, l=c;
		if(max < b){
			max = b;
			k=a;
		}
		if(max < c){
			max = c;
			k=b;
			l=a;
		}

		if(max*max == k*k + l*l)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

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

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

bool is_right_triangle(int a, int b, int c){
  // a2 >= b2 >= c2
  int a2, b2, c2;
  
  if(a >= b && a >= c){
    a2 = a * a;
    
    if(b >= c){
      b2 = b * b;
      c2 = c * c;
    } else {
      b2 = c * c;
      c2 = b * b;
    }
  } else if(b >= a && b >= c){
    a2 = b * b;

    if(a >= c){
      b2 = a * a;
      c2 = c * c;
    } else {
      b2 = c * c;
      c2 = a * a;
    }
  } else if(c >= a && c >= b){
    a2 = c * c;

    if(a >= b){
      b2 = a * a;
      c2 = b * b;
    } else {
      b2 = b * b;
      c2 = a * a;
    }
  }

  cout << a2 << endl;
  cout << b2 << endl;
  cout << c2 << endl;

  return true;
}

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

  int a,b,c;

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

    if(is_right_triangle(a, b, c)) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  
  return 0;
}