#P1128. Minimum Number with Exactly n Divisors

    ID: 13354 Type: Default 1000ms 256MiB

Minimum Number with Exactly n Divisors

Minimum Number with Exactly n Divisors

Given a positive integer \(n\), find the smallest positive integer \(m\) which has exactly \(n\) distinct divisors.

For example, when \(n=4\), the number \(m=6\) because the divisors of 6 are \(1, 2, 3, 6\) and there is no smaller number with exactly 4 divisors.

The divisors of a number \(m\) are defined as the positive integers that divide \(m\) without leaving a remainder.

inputFormat

The input consists of a single positive integer \(n\), where \(n \ge 1\).

outputFormat

Output the smallest positive integer \(m\) which has exactly \(n\) distinct divisors.

sample

1
1