Codeforces Round 943 (Div. 3) |
---|
Finished |
You are given an array x2,x3,…,xn. Your task is to find any array a1,…,an, where:
Here c\bmod d denotes the remainder of the division of the integer c by the integer d. For example 5 \bmod 2 = 1, 72 \bmod 3 = 0, 143 \bmod 14 = 3.
Note that if there is more than one a which satisfies the statement, you are allowed to find any.
The first line contains a single integer t (1\le t\le 10^4) — the number of test cases.
The first line of each test case contains a single integer n (2\le n\le 500) — the number of elements in a.
The second line of each test case contains n-1 integers x_2,\dots,x_n (1\le x_i\le 500) — the elements of x.
It is guaranteed that the sum of values n over all test cases does not exceed 2 \cdot 10^5.
For each test case output any a_1,\dots,a_n (1 \le a_i \le 10^9) which satisfies the statement.
542 4 131 164 2 5 1 2250031 5
3 5 4 9 2 5 11 5 14 16 5 11 24 501 500 2 7 5
In the first test case a=[3,5,4,9] satisfies the conditions, because:
Name |
---|