显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const ll N = 1e5+10,M = 1e18;
ll n,ans = M+10;
int p[N],tot,v[N];
void prim(){
for(int i = 2;i <= 10000;i++){
if(v[i])continue;
p[++tot] = i;
for(int j = i;j * i <= 10000;j++)v[i*j] = 1;
}
}//埃式筛
void dfs(int x,ll m,ll sum,int t){
if(x > 22 || m > ans || m > M || sum > n)return;
if(n == sum){
ans = min(ans,m);
return;
}
for(int i = 1;i <= t;i++)
dfs(x+1,m *= p[x],sum*(i+1),i);
}
int main(){
freopen("CF27E.in","r",stdin);
freopen("CF27E.out","w",stdout);
scanf("%lld",&n);
prim();
dfs(1,1,1,64);
printf("%lld\n",ans);
return 0;
}