#[allow(unused_macros)] macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes .by_ref() .map(|r|r.unwrap() as char) .skip_while(|c|c.is_whitespace()) .take_while(|c|!c.is_whitespace()) .collect() }; input_inner!{next, $($r)*} }; } #[allow(unused_macros)] macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} }; ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => { let mut $var = read_value!($next, $t); input_inner!{$next $($r)*} }; } #[allow(unused_macros)] macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::>() }; ($next:expr, chars) => { read_value!($next, String).chars().collect::>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; } mod vig { use std::cmp::max; use std::cmp::min; /// prime_factor /// usage: for (div, exp) in prime_factor(n) {...} pub fn prime_factor(n: i64, limit:i64) -> i64 { let mut ans:i64 = 0; for i in 2..((n as f64).sqrt() as i64+1) { if n%i==0 { if n/i >= 2&& n/i <=2*limit && i >= 2 && i <=2*limit { // println!("i: {}", i); if n/i == i { if 1 < i-limit { ans+=(2*limit - i+1)*(2*limit - i+1); }else{ ans+=(i-1)*(i-1); } assert_eq!(1,2); }else{ let mut res = 1; if 1 < i-limit { res*=(2*limit - i+1); }else{ res*=(i-1); } if 1 < n/i-limit { res*=(2*limit - n/i+1); }else{ res*=(n/i-1); } ans+=2*res; } } } } ans } } fn main() { input!{ n:i64, k:i64, } let mut ans:i64 = 0; if k<4 || 4*n*n < k { ans =0; }else{ ans = vig::prime_factor(k, n); } println!("{}", ans); }