#P1910G. Pool Records
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 to . Both Alice and Bob started at moment at point with positive real speeds and correspondingly.
Both Alice and Bob swim from to point , then instantly turn back and swim from to . At they turn back again and swim to 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 .
Due to some incident, Monocarp lost almost all data he recorded, and all he has now is array . Monocarp remembers that Alice and Bob had distinct positive real swimming speeds and (; ; ) and that sequence contains the first meeting moments.
But looking at sequence he noticed that all are integer values, and now he doubts is sequence valid or there are some errors in it. Help Monocarp to check array !
The first line contains a single integer () — the number of test cases. Then cases follow.
The first line of each test case contains a single integer () — the size of array .
The second line of each test case contains integers () — the meeting moments in the increasing order.
It's guaranteed that the sum of over all test cases doesn't exceed .
For each test case, print VALID if the array is a valid array, or (in other words) exist such real values and (; ) that array contains the first 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 () — the number of test cases. Then cases follow.
The first line of each test case contains a single integer () — the size of array .
The second line of each test case contains integers () — the meeting moments in the increasing order.
It's guaranteed that the sum of over all test cases doesn't exceed .
Output
For each test case, print VALID if the array is a valid array, or (in other words) exist such real values and (; ) that array contains the first 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.
Note
In the first test case, imagine a situation: and . Then, at moment Alice and Bob will be at point .
In the second test case, imagine a situation: and . Then, at moment Alice and Bob will meet at point , at they'll meet at point , at moment they'll meet at and at moment — at point . Since it's exactly the first meeting moments. Array may be valid.
In the third test case, one of the possible situations is and .