#include #include using namespace std; using namespace atcoder; using ll=long long; int main() { ll k,n; cin>>k>>n; auto is_sq=[](ll x)->bool{ ll l=0,r=1000000000; while(l+1 s; for(ll x=1;x<=1000;x++){ for(ll y=1;y<=10000;y++){ ll t=x*x*x*x*x*x+y*y*y*y; if(t>n||t%k!=0)continue; t/=k; if(is_sq(t))s.insert(t); } } cout<