Vepar
의견: 0
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\).
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\).
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@@RISE_MATH_BLOCK_0@@i \le b@@RISE_MATH_BLOCK_1@@i \le d\)\(i\) ≤
\(10^{7}\)).
Output \(t\) lines in total. For the \(i-th\) test case, output DA (Croatian for yes) if \(a@@RISE_MATH_BLOCK_0@@i + 1\)) · · · \(b\)\(i\) divides
\(c_{i}\) · (\(c_{i} + 1\)) · · · \(d_{i}\), and output NE (Croatian for \(no\)) otherwise.
2
9 10 3 6
2 5 7 9
DA
NE
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
평가 및 의견
Vepar
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Vepar