| Codeforces Round 1024 (Div. 2) |
|---|
| Finished |
Given four integers $$$n$$$, $$$m$$$, $$$p$$$, and $$$q$$$, determine whether there exists an integer array $$$a_1, a_2, \ldots, a_n$$$ (elements may be negative) satisfying the following conditions:
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first and only line of each test case contains four integers $$$n$$$, $$$m$$$, $$$p$$$, and $$$q$$$ ($$$1 \le p \le n \le 100$$$, $$$1 \le q, m \le 100$$$) — the length of the array, the sum of elements, the length of a segment, and the sum of a segment, respectively.
For each test case, output "YES" (without quotes) if there exists an array satisfying the above conditions, and "NO" (without quotes) otherwise.
You can output "YES" and "NO" in any case (for example, strings "yES", "yes", and "Yes" will all be recognized as valid responses).
53 2 2 11 1 1 15 4 2 310 7 5 24 4 1 3
YES YES YES NO NO
In the first test case, an example of an array satisfying the condition is $$$[1, 0, 1]$$$. This is because:
In the second test case, the only array satisfying the condition is $$$[1]$$$.
In the third test case, an example of an array satisfying the condition is $$$[-2, 5, -2, 5, -2]$$$.
In the fourth test case, it can be proven that there is no array satisfying the condition.
| Name |
|---|


