#include using namespace std; using ll = long long; int main () { int T; cin >> T; while (T--) { ll n, p, k; cin >> n >> p >> k; ll m = n / 5; if (k > m * p) { puts("No"); } else { cout << (k % p == 0 || k % p == p-1 ? "Yes" : "No") << endl; } } }