显示代码纯文本
#include<iostream>
#include<cstdio>
using namespace std;
int n,k;
unsigned long long ans=1e18+100,MAXN=1e18;
int vis[10005],p[10005];
void zhishu(){
vis[1]=1;
for(int i=2;i<=1000;i++){
if(vis[i])continue;
for(int j=2;j<=1000/i;j++){
vis[i*j]=1;
}
}
for(int i=1;i<=1000;i++){
if(!vis[i]){
k++;
p[k]=i;
if(k==1000)break;
}
}
}
void dfs(int x,unsigned long long s,int cnt,int t){
if(x>k)return ;
if(s>MAXN||s>ans)return ;
if(cnt>n)return ;
if(cnt==n){
if(s!=0)
ans=min(ans,s);
return ;
}
for(int i=1;i<=t;i++){
dfs(x+1,s*=p[x],cnt*(i+1),t);
}
return ;
}
int main(){
freopen("CF27E.in","r",stdin);
freopen("CF27E.out","w",stdout);
cin>>n;
zhishu();
dfs(1,1,1,64);
cout<<ans<<endl;
return 0;
}