A1609.[COCI-2020-2021-contest4]#5 Vepar
提高+/省选-
通过率:0%
时间限制:1.00s
内存限制:128MB
题目描述
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.
输入格式
The first line contains a single integer t (1 ≤ t ≤ 10), the number of independent test cases.
Each of the following t lines contains four positive integers ai, bi, ci, di (1 ≤ ai ≤ bi ≤ 107, 1 ≤ ci ≤ di ≤10^7).
输出格式
Output t lines in total. For the i-th test case, output DA (Croatian for yes) if ai · (ai + 1)· · · bi divides ci · (ci + 1)· · · di , and output NE (Croatian for no) otherwise.
输入输出样例
输入#1
2 9 10 3 6 2 5 7 9
输出#1
DA NE
说明/提示
In test cases worth 10 points it holds ai, bi, ci, di ≤ 50.
In test cases worth additional 20 points it holds ai, bi, ci, di ≤ 1000.
In test cases worth additional 10 points it holds ai = 1.