//4倍高速化 #include using namespace std; int cnt[10000001]; int X, Y; int main() { cin >> X >> Y; int maxR = 0; while (maxR * maxR <= Y) maxR++; maxR--; for (int x = 1; x <= maxR; x++) { for (int y = 0; y <= maxR; y++) { if (x * x + y * y <= Y) { cnt[x * x + y * y]++; } } } int ans = 0; for (int i = X; i <= Y; i++) { if (ans < cnt[i]) { ans = cnt[i]; } } cout << ans * 4 << endl; return 0; }