#include<iostream>
#include<algorithm>
#include<math.h>
#include<cmath>
#include <numeric>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T;
    cin >> T;
    while (T--) {
        long long p1, p2, k;
        cin >> p1 >> p2 >> k;
        if (k == 1) {
            cout << "NO\n";
            continue;
        }
        long long g = gcd(p1, p2);
        long long R = (p2 / g) - 1;
        long long B = (p1 / g) - 1;
        if (R < 0) R = 0;
        if (B < 0) B = 0;
        long long max_red = (R + B) / (B + 1);
        long long max_blue = (B + R) / (R + 1);
        long long max_val = max(max_red, max_blue);
        if (max_val >= k) {
            cout << "NO\n";
        } else {
            cout << "YES\n";
        }
    }
    return 0;
}