#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using i64 = int64_t; using i32 = int32_t; int main() { i64 x, y; cin >> x >> y; vector mp(1e7 + 1); for (i64 i = 0; i * i <= max(x, y); ++i) { for (i64 j = 1; i * i + j * j <= max(x, y); ++j) { mp[i * i + j * j]++; } } i64 ans = 0; for (int i = x; i <= y; ++i) { if (x <= i && i <= y) ans = max(ans, mp[i]); } cout << 4 * ans << endl; return 0; }