← Back to Problems
Convergence Trichotomy
Easy standard Calculus & Analysis
Time limit: 2 s per test  ·  Memory: 256 MB

For a rational number x = p / q and non-negative integers a, b, c, consider the series

sum over k = 1, 2, 3, ... of k^a x^k / (k + b)^c.

Classify it as one of:

  • ABSOLUTE — the series converges absolutely;
  • CONDITIONAL — the series converges, but not absolutely;
  • DIVERGENT — the series does not converge.

Input

The first line contains the integer m. Each of the next m lines contains the integers p, q, a, b, c describing one series.

Output

m lines, the classification of each series in order.

Constraints

1 <= m <= 10^4

|p| <= 10^9, 1 <= q <= 10^9

0 <= a, b, c <= 10^9

Scoring

This is a standard problem: a submission scores full points if it produces the correct output for every test case, and zero otherwise.

Examples

input
5
1 2 5 0 0
1 1 0 0 2
-1 1 0 0 1
1 1 0 0 1
2 1 0 0 9
output
ABSOLUTE
ABSOLUTE
CONDITIONAL
DIVERGENT
DIVERGENT
input
1
-1 1 1 3 2
output
CONDITIONAL
Python 3.13 i Execution environment Isolated microVM · 1 vCPU · no internet access Time and memory limits are set per problem Available packages numpy 2.5.0scipy 1.18.0pandas 3.0.0scikit-learn 1.9.0statsmodels 0.15.0cvxpy 1.9.2