TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Kuo Double-Junior is obsessed with "Grassy-Muddy Horse", a kind of toys manufactured by the factory "Swinging Grass". It is said that every "Grassy-Muddy Horse" manufactured has a unique binary ID (consists of solely '0' and '1') of fixed length L. Further more, since the boss of "Swinging Grass" hates the digit zero (it's not prime, not really composite either, what the heck?) so each binary ID does not contain consecutive zeroes of length more than Z (a fixed number). The "Grassy Muddy Horses" are manufactured in the order according to their ID's lexicographical order, increasingly.

Kuo wants to buy a "Grassy Muddy Horse", but he has a lucky number, k. Therefore Kuo wants to acquire the k-th "Grassy Muddy Horse" manufactured. However he fails to do so after a period of struggling with zeroes and ones. Please help him find the answer.

Input Format

The first line contain an integer T --- the number of tests(1<=T<=1000).

Each test contains three integers L,Z,k as the problem description(1<=L<=100, 0<=Z<=100, 1<=k<=2,147,483,647).

Output Format

Sample Input 1

3
5 2 1
5 2 2
5 2 32

Sample Output 1

00100
00101
No Solution

Hints

Problem Source

Migrated from old NTUJ.

dreamoon

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 1000