Public Judge

pjudge

実行時間制限: 1 s メモリ制限: 512 MB 満点: 100

#21684. 【NOIP Round #2】Is That It

統計

Little A provides three integers $n, m, k$ such that $0 \le k \le m < n$. He wants Little B to construct a binary string of length $n$.

Little B says, "Is that all?", and writes down $n$ ones. Clearly, this string satisfies the conditions.

Little A does not want too many ones, so he requires that every substring of length $m$ in the binary string contains at most $k$ ones.

Little B says, "Is that all?", and writes down $n$ zeros. Clearly, this string also satisfies the conditions.

Little A also does not want too few ones, so he further requires that every substring of length $m+1$ in the binary string contains at least $k$ ones.

You say, "Is that all?", and you also want to write down a string that satisfies all of Little A's conditions.

In this problem, $T$ is a substring of $S$ if and only if $T$ is formed by removing some (possibly zero) characters from the beginning or the end of $S$.

Input

A single line containing three integers $n, m, k$.

Output

A single line containing a binary string of length $n$. If there are multiple strings that satisfy the conditions, you may output any one of them.

Examples

Input 1

4 2 1

Output 1

0100

Note 1

The string 0100 has $3$ substrings of length $m$, which are 01, 10, and 00. Each of these contains $\le k$ ones.

The string 0100 has $2$ substrings of length $m+1$, which are 010 and 100. Each of these contains $\ge k$ ones.

Therefore, 0100 satisfies the conditions.

Note that there is more than one valid string; for example, 0010 also satisfies the conditions, so outputting 0010 is also correct.

Input 2

5 4 4

Output 2

11111

Constraints

There are $10$ test cases in this problem, each worth $10$ points.

For all test cases, it is guaranteed that $0 \le k \le m < n \le 10^5$ and $0 < m$.

For test cases $1$ and $2$, $n \le 20$.

For test cases $3$ and $4$, $n \le 100$.

For test cases $5$ and $6$, $n \le 1000$.

For test case $7$, $k = m$.

For test case $8$, $m = n - 1$.

For test cases $9$ and $10$, there are no special restrictions.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.