显示代码纯文本
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int a[1000]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,53,59,61};
int n;
int ans=15;
unsigned long long minx=1e18;
bool g(int x){
for(int i=2;i<sqrt(x);i+=2){
if(x%i==0){
return 0;
}
}
return 1;
}
void dfs(int num,unsigned long long s,int x,int t){
if(num>n) return;
if(s>1e18) return;
if(x>ans) return;
if(s>minx) return;
if(num==n){
minx=min(s,minx);
}
for(int i=1;i<=t;i++){
dfs(num*(i+1),s*=a[x],x+1,t);
}
return;
}
int main(){
freopen("CF27E.in","r",stdin);
freopen("CF27E.out","w",stdout);
cin>>n;
for(int i=61;i<=1000;i++){
if(g(i)){
a[ans++]=i;
}
}
dfs(1,1,0,64);
cout<<minx<<endl;
return 0;
}