This is problem 3 of the Victor's Various Adventures
problem set.
Victor is becoming a king! But wait, before he becomes a king, he must prove himself worthy! Traditionally, to become a king, one must complete the following task:
You are given a line of 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!
Can you help Victor solve this task?
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 lines that follows, where the the line contains the integers , and the sum , all of which describe the requirement.
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
Comments