Please enter your email address or userHandle.
You are given an array A , you have to construct a new array A2.
The values in A2 are obtained by doing OR of consecutive elements in array.
First line of the input contains t, the number of test cases. Each line of the test case contains a number n specifying the number of elements.
Each 'n' lines denoting elements of array A.
Each new line of the output contains element of array A2 .
Sample Input 0
10 11 1 2 3
Sample Output 0
11 11 3 3 3
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.