1135 01串


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 64K

Problem types
Allowed languages
C, C++, Java, Python

Description

考虑一个有序集合S,S中的元素都是长度为N,并且”1”的个数不超过L的01串,其中(1<=N<=31,0<=L<=N),并且是按照字典顺序排的, 即00010<01000(当N=5)。求当前集合第I个元素(0<I<=sizeof(S))。

Input

第一行为T,表测试数据组数。接下来一共T行,每行三个整数依次为:N,L,I。

Output

一共T行,每行为当前S中的第I个元素。

Sample

Input

1
5 3 19

Output

10011

Source: 超人


Comments

There are no comments at the moment.