#nullable enable #region var (_input, _iter) = (Array.Empty(), 0); T I() where T : IParsable { while (_iter >= _input.Length) (_input, _iter) = (Console.ReadLine()!.Trim().Split(' '), 0); return T.Parse(_input[_iter++], null); } #endregion static T[] Range(int n, Func F) => Enumerable.Range(0, n).Select(_ => F()).ToArray(); string Solve() { var n = I(); var p = I(); var k = I(); var c = n / 5; if (k % p == 0 && k / p <= c) return "Yes"; k++; if (k % p == 0 && k / p <= c) return "Yes"; return "No"; } var t = I(); var ans = Range(t, Solve); Console.WriteLine(string.Join(Environment.NewLine, ans)); readonly record struct ModInt { public const int Mod = 998244353; int V { get; init; } public ModInt(long value) { var v = value % Mod; if (v < 0) v += Mod; V = (int)v; } static ModInt New(int value) => new(){ V = value }; public static implicit operator ModInt(long v) => new(v); public static implicit operator int(ModInt modInt) => modInt.V; public static ModInt AdditiveIdentity => New(0); public static ModInt operator +(ModInt a, ModInt b) { var v = a.V + b.V; if (v >= Mod) v -= Mod; return New(v); } public ModInt AdditiveInverse() { if (V == 0) return AdditiveIdentity; return New(Mod - V); } public static ModInt operator -(ModInt a, ModInt b) { var v = a.V - b.V; if (v < 0) v += Mod; return New(v); } public static ModInt MultiplicativeIdentity => New(1); public static ModInt operator *(ModInt a, ModInt b) => New((int)((long)a.V * b.V % Mod)); public ModInt MultiplicativeInverse() => V == 0 ? throw new DivideByZeroException() : Power(V, Mod - 2, Mod); public static ModInt operator /(ModInt a, ModInt b) => a * b.MultiplicativeInverse(); static long Power(long v, ulong p, long mod) { var (res, k) = (1L, v); while (p > 0) { if ((p & 1) > 0) res = res * k % mod; k = k * k % mod; p >>= 1; } return res; } public ModInt Power(long p) => p < 0 ? MultiplicativeInverse().Power(-p) : Power(V, (ulong)p, Mod); public override string ToString() => V.ToString(); } static class FactorialExtensions { public static ModInt Factorial(this int value) { Extend(value); return value < 0 ? _inv[-value] : _fac[value]; } public static ModInt P(this int n, int r) { if (r < 0 || r > n) return 0; if (n <= MaxN) return Factorial(n) * Factorial(r - n); ModInt res = 1; for (var i = 0; i < r; i++) res *= n - i; return res; } public static ModInt C(this int n, int r) { if (r < 0 || r > n) return 0; r = Math.Min(r, n - r); return P(n, r) * Factorial(-r); } public static ModInt H(this int n, int r) => C(r + n - 1, r); public static ModInt ModIntInverse(this int n) { if (n == 0) throw new DivideByZeroException(); if (n < 0) return ModIntInverse(-n).AdditiveInverse(); if (n > MaxN) return ((ModInt)n).MultiplicativeInverse(); return Factorial(n - 1) * Factorial(-n); } // [x^k](1-x)^-n = nHk public static ModInt[] NegativeBinomialSeries(long n, int m) { var res = new ModInt[m + 1]; res[0] = 1; for (var i = 1; i <= m; i++) res[i] = res[i - 1] * (n - 1 + i) * ModIntInverse(i); return res; } const int MaxN = (1 << 24) - 1; static ModInt[] _fac = new ModInt[]{ 1 }; static ModInt[] _inv = new ModInt[]{ 1 }; static void Extend(int q) { var l = _fac.Length; if (q < 0) q = -q; if (q < l || MaxN < q) return; while (l <= q) l <<= 1; var fac = new ModInt[l]; var inv = new ModInt[l]; fac[0] = 1; for (var i = 1; i < fac.Length; i++) fac[i] = fac[i - 1] * i; inv[l - 1] = fac[l - 1].Power(-1); for (var i = inv.Length - 1; i > 0; i--) inv[i - 1] = inv[i] * i; (_fac, _inv) = (fac, inv); } }