#K37472. Non-repetitive Binary String Generation
Non-repetitive Binary String Generation
Non-repetitive Binary String Generation
Given an integer \(n\), generate a binary string of length \(n\) such that for every integer \(k\) with \(1 \le k \le \lfloor n/2 \rfloor\), the adjacent substrings of length \(k\) are not identical. In other words, the string must not contain two consecutive identical blocks of any length from 1 up to \(\lfloor n/2 \rfloor\). For example, when \(n = 4\), one valid answer is 0101
(note that alternating digits naturally satisfy this requirement though there exist alternative correct answers).
You are required to process multiple test cases. In each test case, you are given the length of the binary string to generate, and you must output the corresponding binary string constructed by alternating characters starting with '0'.
inputFormat
The input consists of two lines. The first line contains a single integer \(T\) that represents the number of test cases. The second line contains \(T\) space-separated integers, where the \(i^{{th}}\) integer is the value \(n_i\), representing the length of the binary string to be generated for that test case.
outputFormat
For each test case, output the generated binary string on a new line. The output of each test case should be printed to standard output.
## sample3
4 5 7
0101
01010
0101010
</p>