Arithmetic Sequence

No attempts yetTime limit1sMemory limit128 MB

Problem

To pass the time during their long trek through the misty mountains and to prepare for the trials ahead, Gandalf begins teaching mathematics to Bilbo and the thirteen dwarves. One of the ideas he covers is the arithmetic sequence.

A sequence of numbers $x_1, x_2, \ldots, x_n$ is an arithmetic sequence if the difference between every pair of successive terms is the same, that is:

$$x_2 - x_1 = x_3 - x_2 = \cdots = x_n - x_{n-1}.$$

Bilbo and Ori, one of the dwarves, play a game to sharpen their skills. One of them proposes a sequence of numbers, and the other must quickly decide whether it is an arithmetic sequence and, if it is, list the next 5 numbers in the sequence. Write a program that verifies their answers.

Input

The first line contains the number of test cases $T$ ($T < 100$).

Each of the following lines describes one test case. The line begins with an integer $n$, the number of terms in the sequence, followed by the $n$ integers that make up the sequence.

Output

For each test case, print exactly one line.

If the sequence is an arithmetic sequence, print it in this form:

The next 5 numbers after [a1, a2, ...] are: [b1, b2, b3, b4, b5]

where the first list repeats the given sequence and the second list contains the next 5 terms.

If the sequence is not an arithmetic sequence, print:

The sequence [a1, a2, ...] is not an arithmetic sequence.

Reproduce the format exactly, including the square brackets, the commas, and the spacing.