fn main(){ let xy: Vec = read_vec(); let x = xy[0]; let y = xy[1]; let mut i: usize = 1; let mut j: usize = 0; let mut v: Vec = vec![0; y+1]; while i * i <= y { while j * j <= y { let ix = i * i + j * j; if x <= ix && ix <= y { v[ix] += 4; } j += 1; } i += 1; j = 0; } println!("{}", v.iter().max().unwrap()); } fn read_vec() -> Vec where T: std::str::FromStr, T::Err: std::fmt::Debug { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).expect("failed to read"); buf.split_whitespace().map(|e| e.parse().unwrap()).collect() }