문제
Farmer John's farm consists of
Thus, his plan is to partition the set of roads into several paths, and delegate responsibility for each path to a worthy farm hand. To avoid contention, he wants each path to be the same length. He wonders for which lengths there exists such a partition.
More precisely, for each
SCORING:
In test cases 2-4 the tree forms a star; at most one vertex has degree greater than two.
Test cases 5-8 satisfy
N\le 10^3 .Test cases 9-15 satisfy no additional constraints..
Problem credits: Mark Gordon and Dhruv Rohatgi
입력
The first line contains a single integer
The next
출력
Output a bit string of length
예제
13
1 2
2 3
2 4
4 5
2 6
6 7
6 8
8 9
9 10
8 11
11 12
12 13
111000000000
It is possible to partition this tree into paths of length