#P1910G. Pool Records

    ID: 10300 Type: RemoteJudge 3000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 10 Uploaded By: Tags>*special problemgreedy*2700

Pool Records

Description

Alice and Bob are swimming in the pool under the guidance of their instructor Monocarp.

The pool can be represented as a segment on the OX-axis from 00 to 5050. Both Alice and Bob started at moment 00 at point 00 with positive real speeds vAv_A and vBv_B correspondingly.

Both Alice and Bob swim from 00 to point 5050, then instantly turn back and swim from 5050 to 00. At 00 they turn back again and swim to 5050 and so on.

Monocarp logged all valuable info about Alice and Bob, including moments of time when they met at the same point (Alice and Bob swim on parallel lanes, so they don't bother each other). Let's name that moments of time as sequence t1,t2,,tnt_1, t_2, \dots, t_n.

Due to some incident, Monocarp lost almost all data he recorded, and all he has now is array tt. Monocarp remembers that Alice and Bob had distinct positive real swimming speeds vAv_A and vBv_B (vA>0v_A > 0; vB>0v_B > 0; vAvBv_A \neq v_B) and that sequence tt contains the first nn meeting moments.

But looking at sequence tt he noticed that all tit_i are integer values, and now he doubts is sequence tt valid or there are some errors in it. Help Monocarp to check array tt!

The first line contains a single integer cc (1c1041 \le c \le 10^4) — the number of test cases. Then cc cases follow.

The first line of each test case contains a single integer nn (1n21051 \le n \le 2 \cdot 10^5) — the size of array tt.

The second line of each test case contains nn integers t1,t2,,tnt_1, t_2, \dots, t_n (1t1<t2<<tn1091 \le t_1 < t_2 < \dots < t_n \le 10^9) — the meeting moments in the increasing order.

It's guaranteed that the sum of nn over all test cases doesn't exceed 21052 \cdot 10^5.

For each test case, print VALID if the array tt is a valid array, or (in other words) exist such real values vAv_A and vBv_B (vA,vB>0v_A, v_B > 0; vAvBv_A \neq v_B) that array tt contains the first nn meeting moments of Alice and Bob in the pool.

Otherwise, print INVALID.

You can output the answer in any case (upper or lower). For example, the strings "vALid", "valid", "Valid", and "VALID" will be recognized as positive responses.

Input

The first line contains a single integer cc (1c1041 \le c \le 10^4) — the number of test cases. Then cc cases follow.

The first line of each test case contains a single integer nn (1n21051 \le n \le 2 \cdot 10^5) — the size of array tt.

The second line of each test case contains nn integers t1,t2,,tnt_1, t_2, \dots, t_n (1t1<t2<<tn1091 \le t_1 < t_2 < \dots < t_n \le 10^9) — the meeting moments in the increasing order.

It's guaranteed that the sum of nn over all test cases doesn't exceed 21052 \cdot 10^5.

Output

For each test case, print VALID if the array tt is a valid array, or (in other words) exist such real values vAv_A and vBv_B (vA,vB>0v_A, v_B > 0; vAvBv_A \neq v_B) that array tt contains the first nn meeting moments of Alice and Bob in the pool.

Otherwise, print INVALID.

You can output the answer in any case (upper or lower). For example, the strings "vALid", "valid", "Valid", and "VALID" will be recognized as positive responses.

Sample Input 1

7
1
42
4
3 4 6 8
5
1 2 3 4 5
3
999999998 999999999 1000000000
5
4 6 8 12 16
4
6 11 12 14
2
10 30

Sample Output 1

VALID
VALID
VALID
INVALID
VALID
INVALID
INVALID

Note

In the first test case, imagine a situation: vA=1v_A = 1 and vB=2921v_B = \frac{29}{21}. Then, at moment 4242 Alice and Bob will be at point 4242.

In the second test case, imagine a situation: vA=1756v_A = \frac{175}{6} and vB=256v_B = \frac{25}{6}. Then, at moment 33 Alice and Bob will meet at point 12.512.5, at 44 they'll meet at point 503\frac{50}{3}, at moment 66 they'll meet at 2525 and at moment 88 — at point 1003\frac{100}{3}. Since it's exactly the first 44 meeting moments. Array tt may be valid.

In the third test case, one of the possible situations is vA=25v_A = 25 and vB=75v_B = 75.