#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { int x, y; cin >> x >> y; int p[100] = { 72,96,96,96,96,96,96,96,128,96,128,128,108,128,128,96,128,128,96,128,144,128,128,128,128,128,144,144,128,144,128,128,128,128,144,128,128,128,144,128,160,144,128,144,128,144,144,128,128,144,144,160,144,144,144,128,160,144,144,192,128,144,128,144,144,192,128,128,144,144,144,128,144,160,144,144,144,144,144,128,160,144,144,192,192,144,128,160,128,144,144,144,144,128,144,144,160,192,144,144, }; int m = 0; for (int r = x; r <= y; r++) { if (r % 100000 == 1) { for (int i = r / 100000; i < y / 100000; i++) { m = max(m, p[i]); } r = y / 100000 * 100000 + 1; } int b = 0, c = 0; for (int a = (int)sqrt(r); b = (int)sqrt(r - a * a), a >= b; a--) { if (a * a + b * b == r) { c++; if (a > b && b != 0) c++; } } m = max(m, c * 4); } cout << m << endl; return 0; }