#![allow(unused_imports)] #![allow(non_snake_case)] use std::cmp::*; use std::collections::*; use std::io::Write; #[allow(unused_macros)] macro_rules! debug { ($($e:expr),*) => { #[cfg(debug_assertions)] $({ let (e, mut err) = (stringify!($e), std::io::stderr()); writeln!(err, "{} = {:?}", e, $e).unwrap() })* }; } fn count(ab: i64, n: i64) -> i64 { assert!(ab > 1); let a_min = max(1, ab - n); let a_max = min(ab - 1, n); max(a_max - a_min + 1, 0) } fn main() { let n = read::(); let k = read::(); let mut i = 2; let mut ans = 0i64; while i * i <= k { if k % i == 0 { let ab = i; let cd = k / i; debug!(ab, cd, count(ab, n), count(cd, n)); let mut temp = count(ab, n) * count(cd, n); if ab != cd { temp *= 2; } ans += temp; } i += 1; } println!("{}", ans); } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { read::() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() }