using System.Collections.Generic; using System; public class P { public long p { get; set; } public long q { get; set; } } public class Hello { static void Main() { var n = long.Parse(Console.ReadLine().Trim()); var k = long.Parse(Console.ReadLine().Trim()); var ps = getPS(k); getAns(ps, n); } static long calc(long k, long a) { if (a > 2 * k + 1) return 0; if (a <= k) return a - 1; return 2 * k - a + 1; } static void getAns(List

ps, long k) { var ans = 0L; foreach (var x in ps) ans += calc(k, x.p) * calc(k, x.q); Console.WriteLine(ans); } static List

getPS(long n) { var ps = new List

(); for (long i = 2; i * i <= n; i++) { if (n % i == 0) { if (n / i != i) { ps.Add(new P { p = i, q = n / i }); ps.Add(new P { p = n / i, q = i }); } else ps.Add(new P { p = i, q = i }); } } return ps; } }