{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"## 题目描述\n\n你有价值为 $n$ 的 $a$ 枚硬币和价值为 $1$ 的 $b$ 枚硬币。你总是使用恰好的找零方式支付,因此你想知道是否存在这样的 $x$ 和 $y$,使得你拿走 $x$ ($0 \\le x \\le a$)枚价值为 $n$ 的硬币和 $y$ ($0 \\le y \\le b$)枚价值为 $1$ 的硬币,拿走的硬币的总价值为 $S$。\n\n你需要回答 $q$ 个独立的测试样例。\n\n## 输入格式\n\n输入的第一行包含一个整数 $q$($1 \\le q \\le 10^4$)——测试样例的数量。接下来的 $q$ 行,每行包含四个整数 $a$、$b$、$n$ 和 $S$($1 \\le a, b, n, S \\le 10^9$)——价值为 $n$ 的硬币的数量、价值为 $1$ 的硬币的数量、$n$ 的值和所需的总价值。\n\n## 输出格式\n\n对于第 $i$ 个测试样例,如果存在这样的 $x$ 和 $y$,使得你拿走 $x$ 枚价值为 $n$ 的硬币和 $y$ 枚价值为 $1$ 的硬币,拿走的硬币的总价值为 $S$,则输出 `YES`,否则输出 `NO`。\n\n你可以将答案的每个字母以任何大小写输出,例如 `yEs`、`yes`、`Yes` 和 `YES` 都将被认为是正面答案。\n\n## 样例输入 1\n\n```\n4\n1 2 3 4\n1 2 3 6\n5 2 6 27\n3 3 5 18\n```\n\n## 样例输出 1\n\n```\nYES\nNO\nNO\nYES\n```\n\n\n\u003cp\u003eYou have $$$a$$$ coins of value $$$n$$$ and $$$b$$$ coins of value $$$1$$$. You always pay in exact change, so you want to know if there exist such $$$x$$$ and $$$y$$$ that if you take $$$x$$$ ($$$0 \\le x \\le a$$$) coins of value $$$n$$$ and $$$y$$$ ($$$0 \\le y \\le b$$$) coins of value $$$1$$$, then the total value of taken coins will be $$$S$$$.\u003c/p\u003e\n\u003cp\u003eYou have to answer $$$q$$$ independent test cases.\u003c/p\u003e"}},{"title":"Input","value":{"format":"MD","content":"\u003cp\u003eThe first line of the input contains one integer $$$q$$$ ($$$1 \\le q \\le 10^4$$$) — the number of test cases. Then $$$q$$$ test cases follow.\u003c/p\u003e\n\u003cp\u003eThe only line of the test case contains four integers $$$a$$$, $$$b$$$, $$$n$$$ and $$$S$$$ ($$$1 \\le a, b, n, S \\le 10^9$$$) — the number of coins of value $$$n$$$, the number of coins of value $$$1$$$, the value $$$n$$$ and the required total value.\u003c/p\u003e"}},{"title":"Output","value":{"format":"MD","content":"\u003cp\u003eFor the $$$i$$$-th test case print the answer on it — \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e (without quotes) if there exist such $$$x$$$ and $$$y$$$ that if you take $$$x$$$ coins of value $$$n$$$ and $$$y$$$ coins of value $$$1$$$, then the total value of taken coins will be $$$S$$$, and \u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e otherwise.\u003c/p\u003e\n\u003cp\u003eYou may print every letter in any case you want (so, for example, the strings \u003cspan class\u003d\"tex-font-style-tt\"\u003eyEs\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eyes\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e will all be recognized as positive answer).\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n1 2 3 4\n1 2 3 6\n5 2 6 27\n3 3 5 18\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nNO\nNO\nYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}