#P1463B. Find The Array
Find The Array
Description
You are given an array such that . Let be the sum of all elements of the array .
Let's call an array of integers beautiful if:
- for each from to ;
- for every pair of adjacent integers from the array , either divides , or divides (or both);
- .
Your task is to find any beautiful array. It can be shown that at least one beautiful array always exists.
The first line contains one integer () — the number of test cases.
Each test case consists of two lines. The first line contains one integer ().
The second line contains integers ().
For each test case, print the beautiful array () on a separate line. It can be shown that at least one beautiful array exists under these circumstances. If there are multiple answers, print any of them.
Input
The first line contains one integer () — the number of test cases.
Each test case consists of two lines. The first line contains one integer ().
The second line contains integers ().
Output
For each test case, print the beautiful array () on a separate line. It can be shown that at least one beautiful array exists under these circumstances. If there are multiple answers, print any of them.