3078: Binary Number

时间限制:1000 ms 内存限制:128 MB
上传者:
提交:3 通过:2

题目描述

As a programmer, you are probably familiar with the binary representation of integers. That is, write an integer $x$ as $\sum a_{i}2^{i}$, where each $a_{i}$ is either $0$ or $1$. Particularly, $n$-digit binary number can be written as $\sum_{i = 0}^{n-1} a_{i}2^{i}$, in which $a_{n-1}$ must equal to $1$.

This time, to test your mastery of binary numbers, Leg Han raises a problem to you.

Among all $n$-digit binary numbers whose amount of $1$ is $m$, please print the $k$-th smallest one.


It is guaranteed that k is legal.

输入格式

The first line contains an integer number T, the number of test cases.

$i^{th}$ of each next T lines contains three integers $n$, $m$, $k$($1 \leq m \leq n \leq 31, 1 \leq k \leq 2\times 10^{8}$).

输出格式

For each test case print the $k$-th smallest one.

输入样例 复制

2
5 2 2
5 3 3

输出样例 复制

10010
10110