open Scanf open Printf let divs n = let ans = ref [] in let i = ref 1 in while !i * !i <= n do if n mod !i = 0 then begin ans := !i :: !ans; if !i * !i < n then ans := (n / !i) :: !ans; end; incr i; done; !ans let () = let n, k = scanf "%d %d" (fun x y -> x, y) in divs k |> List.map (fun x -> let y = k / x in let ax = max 0 (min n (x - 1) - max 1 (x - n) + 1) in let ay = max 0 (min n (y - 1) - max 1 (y - n) + 1) in ax * ay) |> List.fold_left (+) 0 |> printf "%d\n"