luogu#P5164. xtq的定向越野
xtq的定向越野
Background
xtq has an unusual talent for orienteering. In first grade, he won first place in the "Problem-Solving Cup" and also won the "Cricket Cup" "cricket". One day, he was studying a problem.
Problem Description
xtq wants to design a circular map, which can be seen as a circle. On the circumference, there are any number of non-overlapping checkpoints, and each checkpoint has some tasks.
Let all possible tasks form a -element set. Then this set has distinct subsets, denoted as . Each checkpoint has exactly one task subset among . Note that different checkpoints may have the same task subset.
xtq wants to satisfy the following conditions:
: For any subsets , satisfying , there exists exactly one pair of adjacent checkpoints whose task subsets are and .
: For any adjacent checkpoints with subsets , , it always holds that .
Now xtq gives you an , and he wants you to find all possible such that there exists at least one way to place checkpoints and assign tasks.
In the above description, denotes the number of elements in , and denotes the absolute value of .
Input Format
One positive integer .
Output Format
Output several lines. Each line contains one positive integer, representing a possible , in increasing order.
3
2
Hint
[Sample Explanation]
When , suppose all possible tasks are . Then the 4 subsets of tasks are , , , . The following figure shows one valid arrangement:

In the figure, should be (typo).
[Constraints]
For of the testdata, .
For of the testdata, fits in the range of , and .
Translated by ChatGPT 5