题目链接:点击打开链接
#include<iostream>
#define LL long long
using namespace std;
LL check(LL mm)
{
LL ans=0;
for(LL i=2;i*i*i<=mm;i++)
ans+=mm/(i*i*i);
return ans;
}
int main()
{
LL m;
while(~scanf("%lld",&m))
{
LL l=2,r=1e16,mid;
//cout<<r<<endl;
while(l<=r)
{
mid=(l+r)/2;
if(check(mid)>=m)
{
r=mid-1;
}
else
l=mid+1;
}
if(check(l)==m)
cout<<l<<endl;
else
cout<<"-1"<<endl;
}
return 0;
}