Divisors

Given a positive integer D (1 ≤ D ≤ 100000), your task is to find the smallest number N with exactly D divisors. In the case where N exceeds 1018, output –1 as the result.

Few example cases are presented below.

Input Output Comment
1 1 Smallest number with one divisor.
1 2 Smallest number with two divisors: 1 and 2.
3 4 Smallest number with three divisors: 1, 2 and 4.