use std::cmp::max; fn main() { let mut xy = String::new(); std::io::stdin().read_line(&mut xy).ok(); let xy: Vec = xy.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let x = xy[0]; let y = xy[1]; let mut result: Vec = vec![0; y+1]; for i in 0..y { let a: usize = i * i; if a > y { break; } for j in i..y { let b: usize = j * j; if a + b > y { break; } if a + b < x { continue; } if a == 0 || i == j { result[a+b] += 4; } else { result[a+b] += 8; } } } let mut val: usize = 0; for i in x..=y { val = max(val, result[i]); } println!("{}", val); }