#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int m,n,k,j,i,sum=0;
    while(cin>>j)
    {
       for(i=0;i<j;i++)
    {
    cin>>m>>n>>k;
    sum=sqrt((m*m)+(n*n));
    if(k==sum)
    {
        cout<<"YES"<<endl;
    }
    else
    cout<<"NO"<<endl;
    }

    }

return 0;
}