#P2810. Catch the theives
Catch the theives
Description
karlven heard that while the guards were on duty playing games, they saw cows rolling out of the school gate (ate too much?). This breed of cow is very greedy and also orderly. How is that reflected? When stealing food they line up, and the amount eaten by each later cow is an integer multiple (denote as , ) of the previous cow’s amount. Based on his experience, these cows can eat at most tons of food; once they exceed it, they die and turn to ashes. Therefore, a cow will not eat more than tons, and can only eat one ton at a time. If any cow cannot eat its required amount, it will attack its companion and then commit suicide.
Now karlven does not tell you the value of , and only tells you the number () of schemes in which the cows can steal together and roll out safely together. Please compute the value of . If there are multiple answers, output the smallest possible value. If you cannot find any such , output and then file a complaint against the guards.
Input Format
A single integer .
Output Format
Your computed answer, a single integer.
1
8
8
54
Hint
Constraints: For of the testdata, .
Sample explanation:
Sample #1: (1, 2, 4, 8).
Sample #2: (1, 2, 4, 8), (1, 3, 9, 27), (2, 4, 8, 16), (2, 6, 18, 54), (3, 6, 12, 24), (4, 8, 16, 32), (5, 10, 20, 40), (6, 12, 24, 48).
Translated by ChatGPT 5
京公网安备 11011102002149号