#P2810. Catch the theives

Catch the theives

Description

karlven heard that while the guards were on duty playing games, they saw 44 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 kk, k>1k>1) of the previous cow’s amount. Based on his experience, these cows can eat at most mm tons of food; once they exceed it, they die and turn to ashes. Therefore, a cow will not eat more than mm 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 mm, and only tells you the number nn (n1015n \le 10^{15}) of schemes in which the cows can steal together and roll out safely together. Please compute the value of mm. If there are multiple answers, output the smallest possible value. If you cannot find any such mm, output 1-1 and then file a complaint against the guards.

Input Format

A single integer nn.

Output Format

Your computed answer, a single integer.

1
8
8
54

Hint

Constraints: For 100%100\% of the testdata, n1015n \le 10^{15}.

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