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 10<sup class="upper-index">18</sup>.
The first line of the input contains integer *n* (1 ≤ *n* ≤ 1000).
#include <bits/stdc++.h>
using namespace std;
int arr[]={2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
long long ans=1e18;
long long int solve(int n,int i ,long long int l){
    if (n==1)
        return l;
    if (l>ans || i==10){
        return 1e18;
    }
    for (int j =2;j <60;j++){
        if (n%j==0){
            if ((log10(l)+(j-1)*log10(arr[i]))<18){
            long long int a=solve(n/j,i+1,l*pow(arr[i],j-1));
            if (a<ans)
                ans=a;

            }
        }
    }
    return 1e18;

}
int main() {
    int n;
    cin>>n;
    solve(n,0,1);
    if (n==1)
        cout<<1;
    else
        cout<<ans;
}