Two intervals of positive integers {a, $a + 1$, . . . , b} and {c, $c + 1$, . . . , d} are given. Determine whether the product $c$·($c+1$) · · · $d$ is divisible by the product $a$·($a+1$) · · · $b$.
Input
The first line contains a single integer $t$ ($1 \le t \le 10$), the number of independent test cases. Each of the following $t$ lines contains four positive integers $a_{i}$, $b_{i}$, $c_{i}$, $d_{i}$ ($1 \le a_{i} \le b_{i} \le 10^{7}$, $1 \le c_{i} \le d_{i}$ ≤ $10^{7}$).
Output
Output $t$ lines in total. For the $i$-th test case, output DA (Croatian for yes) if $a_{i}$ · ($a_{i} + 1$) · · · $b_{i}$ divides $c_{i}$ · ($c_{i} + 1$) · · · $d_{i}$, and output NE (Croatian for $no$) otherwise.
Constraints
In test cases worth 10 points it holds $a_{i}$, $b_{i}$, $c_{i}$, $d_{i} \le 50$. In test cases worth additional 20 points it holds $a_{i}$, $b_{i}$, $c_{i}$, $d_{i} \le 1000$. In test cases worth additional 10 points it holds $a_{i} = 1$.
Example 1
2 9 10 3 6 2 5 7 9
DA NE
Example 2
6 1 2 3 4 1 4 2 3 2 3 1 4 1 3 2 4 19 22 55 57 55 57 19 22
DA NE DA DA DA DA
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.