#P10950. 太鼓达人

太鼓达人

Problem Description

The drum in Taiko no Tatsujin is broken, and now vani is here to fix it.

The main component of the drum is MM sensors arranged in a circle.

Each sensor has two working states, on and off, denoted by 11 and 00, respectively.

Obviously, starting from different positions and checking KK consecutive sensors clockwise, you can obtain MM binary strings of length KK.

Vani knows that these MM binary strings should be pairwise distinct.

Also, the drum is very precisely designed, so MM takes the maximum possible value.

Now Vani already knows the value of KK. He wants you to find the value of MM and give the lexicographically smallest sensor arrangement.

Input Format

An integer KK.

Output Format

An integer and a binary string, separated by a space, representing the maximum possible MM and the lexicographically smallest arrangement.

Character 00 means off, and 11 means on. In the string you output, the first character and the last character are adjacent.

3
8 00010111

Hint

Constraints: 2K112\le K\le 11.

Translated by ChatGPT 5