#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; map mp; for (i64 i = 0; i * i <= max(x, y); ++i) { for (i64 j = 1; j * j <= max(x, y); ++j) { mp[i * i + j * j]++; } } i64 ans = 0; for (auto p : mp) { i64 k, c; tie(k, c) = p; if (x <= k && k <= y) ans = max(ans, c); } cout << 4 * ans << endl; return 0; }