CF1957B.A BIT of a Construction

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

A BIT of a Construction

Given integers nn and kk, construct a sequence of nn non-negative (i.e. 0\geq 0) integers a1,a2,,ana_1, a_2, \ldots, a_n such that

  1. um\limits_{i = 1}^n a_i = k
  2. The number of 11s in the binary representation of a1a2ana_1 | a_2 | \ldots | a_n is maximized, where | denotes the bitwise OR operation.

Input

The first line contains a single integer tt (1t1041 \leq t \leq 10^4) — the number of test cases.

The only line of each test case contains two integers nn and kk (1n21051 \leq n \leq 2 \cdot 10^5, 1k1091 \leq k \leq 10^9) — the number of non-negative integers to be printed and the sum respectively.

It is guaranteed that the sum of nn over all test cases does not exceed 21052 \cdot 10^5.

Output

For each test case, output a sequence a1,a2,,ana_1, a_2, \ldots, a_n on a new line that satisfies the conditions given above.

If there are multiple solutions, print any of them.

Note

In the first test case, we have to print exactly one integer, hence we can only output 55 as the answer.

In the second test case, we output 1,21, 2 which sum up to 33, and 12=(11)21 | 2 = (11)_2 has two 11s in its binary representation, which is the maximum we can achieve in these constraints.

In the fourth test case, we output 3,1,1,32,2,123, 1, 1, 32, 2, 12 which sum up to 5151, and 31132212=(101111)23 | 1 | 1 | 32 | 2 | 12 = (101\,111)_2 has five 11s in its binary representation, which is the maximum we can achieve in these constraints.

Samples

4
1 5
2 3
2 5
6 51
5
1 2
5 0
3 1 1 32 2 12

在线编程 IDE

建议全屏模式获得最佳体验