#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int cant,a,b,hip;
	float cat;
	cin>>cant;
	for(int i=0;i<cant;i++)
	{
		do
		{
			cin>>a>>b>>hip;
		}while(a<1||a>1000||b<1||b>1000||hip<1||hip>1000);
		cat=(a*a)+(b*b);
		if(sqrt(cat)==hip)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}