PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000385. Số nhỏ nhất có đúng n ước (Number With The Given Amount Of Divisors)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Số nhỏ nhất có đúng n ước (Number With The Given Amount Of Divisors)

Number With The Given Amount Of Divisors

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

A positive divisor of xx is a positive integer dd such that dd divides xx. For example, the positive divisors of 66 are 1,2,3,61,2,3,6.

Given nn, find the smallest positive integer xx having exactly nn positive divisors. It is guaranteed that the answer does not exceed 101810^{18}.

Input

A single integer nn.

Output

The smallest positive integer with exactly nn positive divisors.

Subtasks

  • Subtask 1 (20 points): 1≤n≤121\le n\le12, answer ≤1018\le10^{18}.

  • Subtask 2 (30 points): 1≤n≤1001\le n\le100, answer ≤1018\le10^{18}.

  • Subtask 3 (50 points): 1≤n≤10001\le n\le1000, answer ≤1018\le10^{18}.

Examples

Example 1

Input

4

Output

6

Explanation

66 has four positive divisors, 1,2,3,61,2,3,6, whereas every smaller positive number has fewer than four.

Example 2

Input

6

Output

12

Explanation

12=22⋅312=2^2\cdot3 has (2+1)(1+1)=6(2+1)(1+1)=6 positive divisors. No smaller positive integer has exactly six.