Codeforces Round 1030 (Div. 2)
A
Equal Subsequences
Codeforces
800
原题
←B →
翻译中…

We call a bitstring$^{\text{∗}}$ perfect if it has the same number of $\mathtt{101}$ and $\mathtt{010}$ subsequences$^{\text{†}}$. Construct a perfect bitstring of length $n$ where the number of $\mathtt{1}$ characters it contains is exactly $k$.

翻译中…

It can be proven that the construction is always possible. If there are multiple solutions, output any of them.

翻译中…

$^{\text{∗}}$A bitstring is a string consisting only of the characters $\mathtt{0}$ and $\mathtt{1}$.$^{\text{†}}$A sequence $a$ is a subsequence of a string $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly zero or all) characters.

翻译中…

Input

翻译中…

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 500$). The description of the test cases follows.

翻译中…

The first line of each test case contains two integers $n$ and $k$ ($1 \le n \le 100$, $0 \le k \le n$) — the size of the bitstring and the number of $\mathtt{1}$ characters in the bitstring.

翻译中…

Output

翻译中…

For each test case, output the constructed bitstring. If there are multiple solutions, output any of them.

翻译中…

Note

翻译中…

In the first test case, the number of $\mathtt{101}$ and $\mathtt{010}$ subsequences is the same, both being $1$, and the sequence contains exactly two $\mathtt{1}$ characters.

翻译中…

In the second test case, the number of $\mathtt{101}$ and $\mathtt{010}$ subsequences is the same, both being $2$, and the sequence contains exactly three $\mathtt{1}$ characters.

翻译中…

In the third test case, the number of $\mathtt{101}$ and $\mathtt{010}$ subsequences is the same, both being $0$, and the sequence contains exactly five $\mathtt{1}$ characters.

翻译中…

样例

Input #1
5
4 2
5 3
5 5
6 2
1 1
Output #1
1010
10110
11111
100010
1
InputCopy OutputCopy
题目信息
题号
2118A
时间限制
1 s
内存限制
256 MB
标签
构造
贪心

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。