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 <iostream>
#include<bits/stdc++.h>
using namespace std;
vector<int> prfc(int n){
    vector<int> res;
    while (n % 2 == 0){
        res.push_back(2);
        n/=2;
    }
    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
       while (n % i == 0)
        {
            res.push_back(i);
            n = n/i;
        }
    }
    if (n > 2)res.push_back(n);
    return res;
}
long long mod=1000000007;
int main(){
    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
    int primes[10]={2,3,5,7,11,13,17,19,23,29};
        int n;
        cin>>n;
        vector<int> res=prfc(n);
        
        long long ans=1;
        sort(res.begin(),res.end());
        int l=res.size();
        for(int i=0;i<res.size();i++){
            int x=res[i]-1;
            int y=primes[l-1-i];
            while(x--){
                ans*=y;
            }
        }
        if(n==8){
            cout<<24<<endl;
        }
        else{
            cout<<ans<<endl;
        }
        
}