#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>n>>k; ll ans=0; for(ll i=2;i<=sqrt(k);i++){ 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; } if(i!=sqrt(k)){ ans+=2*tmp; } else{ ans+=tmp; } } cout<