B. Roof Construction
It has finally been decided to build a roof over the football field in School 179. Its construction will require placing
As the chief, you know that the cost of construction of consecutive pillars is equal to the maximum value of the bitwise XOR of heights of all pairs of adjacent pillars. In other words, the cost of construction is equal to
Find any sequence of pillar heights
In this problem, a permutation is an array consisting of
Each test contains multiple test cases. The first line contains the number of test cases
The only line for each test case contains a single integer
It is guaranteed that the sum of
For each test case print
If there are multiple answers, print any of them.
For
[0,1] — cost of construction is0⊕1=1 .[1,0] — cost of construction is1⊕0=1 .
For
[0,1,2] — cost of construction ismax(0⊕1,1⊕2)=max(1,3)=3 .[0,2,1] — cost of construction ismax(0⊕2,2⊕1)=max(2,3)=3 .[1,0,2] — cost of construction ismax(1⊕0,0⊕2)=max(1,2)=2 .[1,2,0] — cost of construction ismax(1⊕2,2⊕0)=max(3,2)=3 .[2,0,1] — cost of construction ismax(2⊕0,0⊕1)=max(2,1)=2 .[2,1,0] — cost of construction ismax(2⊕1,1⊕0)=max(3,1)=3 .
why are u lying
ReplyDeletechutiya banata hai madarjaat
ReplyDelete