int calc(int r){ int ans = 0; int high = floor(sqrt(r)); REP(x, high){ int y, yy; yy = r-x*x; y = floor(sqrt(yy)); ans += (y*y == yy); } return ans*4; } { int x,y,best=0; rd(x,y); REP(i,x,y+1) best = max(best, calc(i)); wt(best); }