// I SELL YOU...! #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using P = pair; using TP = tuple; void init_io(){ cin.tie(0); ios::sync_with_stdio(false); cout << setprecision(18); } #define MAX 2*(2100*2100) vector mv(MAX,0); signed main(){ init_io(); ll n,d,ans=0; cin >> n >> d; for(ll i=1;i<=n;i++){ for(ll j=1;j<=n;j++){ mv[i*i+j*j]++; } } for(ll w=1;w<=n;w++){ for(ll z=1;z<=n;z++){ ll x = d + w*w - z*z; if(x>=0&&x