#P8589. 『JROI-8』对了,还有花,少女,银河
『JROI-8』对了,还有花,少女,银河
Background

"Part 1"
Even if I turn into bones, there are still things I do not want to forget.
Reprint permission has been granted.
Problem Description
Given , construct a binary string of length containing only such that the numbers of occurrences of are equal, or report that there is no solution.
Here, an "occurrence" means being exactly the same as a consecutive substring of the original string. For example, in , the numbers of occurrences of are , respectively.
Note that the large sample is not provided as an attached file, but is placed directly in Sample #3 of the Input/Output Samples.
Input Format
One line containing a positive integer .
Output Format
If there is a solution, output one line with a length binary string containing only that satisfies the condition.
If there is no solution, output -1.
3
-1
5
00110
15400
-1
Hint
Constraints
| Test Point ID | Score | Special Property | |
|---|---|---|---|
| None | |||
| None | |||
Translated by ChatGPT 5