CF BUDDY
← Problems·

27E · Number With The Given Amount Of Divisors

2000 · brute force, dp, number theory

Problem: Given the number n, find the smallest positive integer which has exactly n divisors. It is guaranteed that for the given n the answer will not exceed 1018.

Input Format: The first line of the input contains integer n (1 ≤ n ≤ 1000).

Output Format: Output the smallest positive integer with exactly n divisors.

Sample Cases

Case 1

Input

4

Output

6

Case 2

Input

6

Output

12

Similar problems

00:00:00
Loading editor…
Welcome! I'm your coding tutor for this problem. Use the chips below to reveal stored hints or get AI feedback on your code. I'll guide you step by step — never giving away the solution.

Sign in to unlock AI tutor feedback