/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming
Final Contest

Solution to Simple Factoring: https://open.kattis.com/problems/simplefactoring
*/

#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
    //Process test cases
    int t; cin >> t;
    while(t--) {
        ll a, b, c;
        cin >> a >> b >> c;

        //Check that the discriminant is a perfect square and non-negative
        ll disc = b*b - 4*a*c;
        //Binary search for sqrt(disc) (no floating points!)
        ll lo = 0, hi = 1000000000;
        while(lo < hi) {
            ll m = (lo + hi) / 2;
            if(m*m < disc) lo = m+1;
            else hi = m;
        }

        //If disc is a positive perfect square, then the equation is factorable
        if(lo*lo != disc) cout << "NO\n";
        else cout << "YES\n";
    }
}