Searching in Binary

View as PDF

Points: 7
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

You are becoming a king! But wait, before you become a king, you must prove yourself worthy! Traditionally, to become a king, you must complete the following task:

You are given marbles, each marble is either black or white. You are then given requirements, where the requirement states that between marbles and there must be exactly white marbles. You must find one such valid arrangement! It is guaranteed that there will always be a valid arrangement!

Input Specification

The first line consists of the integer indicating the number of test cases.

Each test case will start with the integers and on its own line, representing the number of marbles and requirements respectively.

There will be following lines, the line containing the range , and the sum .

Output Specification

For each test case, output a valid sequence on its own line.

Please note, white marbles should be represented as the digit 1 and black marbles with the digit 0.

There could be multiple solutions, any valid solution will be accepted.

Sample Input

2
8 2
1 4 3
1 8 5
5 6
3 3 0
1 5 3
1 3 2
2 5 2
2 4 2
1 5 3

Sample Output

1 0 1 1 0 0 1 1
1 1 0 1 0