#include using namespace std; #define il __int128 #define ll long long ll get_log(ll x){ ll cnt=1; ll res=0; while(cnt>=1; } return res; } il solve(ll k){ ll res=ceil(powl(N,(long double)(1.0/k))); ll l=1,r=res,t=res; // cout<>1 ; if(qpow(mid,p)*qpow(mid+1,k-p)>N){ r=mid-1; t=mid; }else{ l=mid+1; } } resl=(resl(ax-ay)*k+ay*solve(k) ? (ax-ay)*k+ay*solve(k) : ans); } while(ans){ ans1[++len]=ans%10; ans/=10; } for(int i=len;i>=1;i--){ printf("%d",ans1[i]); } return 0; }