#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;ibool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b enum_div(ll n){ //O(n^1/2) vector ret; for(ll i=1;i*i<=n;i++) { if(n%i==0) { ret.push_back(i); if(i!=1&&i*i!=n) { ret.push_back(n/i); } } } ret.push_back(n);//if needed //sort(ret.begin(),ret.end());//if needed return ret; } int main(){ ll n,k; cin>>n>>k; ll ans=0; auto v=enum_div(k); for(auto i:v){ if(k%i) continue; ll num=k/i; if(i>2*n||num>2*n) continue; ll t1,t2; if(i<=n+1){ t1=i-1; } else{ t1=i-1-(i-1-n)*2; } if(num<=n+1){ t2=num-1; } else{ t2=num-1-(num-1-n)*2; } ll tmp=0; if(t1%2==0&&t2%2==0) tmp+=t1*t2; else if (t1%2==1&&t2%2==0){ tmp+=4*((t1/2)*(t2/2)); tmp+=t2; } else if(t1%2==0&&t2%2==1){ tmp+=4*((t1/2)*(t2/2)); tmp+=t1; } else{ tmp+=4*((t1/2)*(t2/2)); tmp+=t1+t2; } ans+=tmp; } cout<