## https://yukicoder.me/problems/no/2846 def calc_gcd(A, B): """ 正の整数A, Bの最大公約数を計算する """ a = max(A, B) b = min(A, B) while a % b > 0: c = a % b a = b b = c return b def main(): K, N = map(int, input().split()) total = 1 for n in range(2, N + 1): gcd = calc_gcd(total, n) total = (total // gcd) * n candidates = [] for i in range(1 , N + 1): candidates.append(total // i) # 取り分 def dfs(N, K, candidates, total, index, xxx, c): if total == 0 and K == 0: return c elif total == 0 and K > 0: return 0 elif total > 0 and K == 0: return 0 if total < candidates[-1] * K: return 0 if total > candidates[index] * K: return 0 ans = 0 for ind in range(index, len(candidates)): if total - candidates[ind] < 0: continue xxx[ind] += 1 ans += dfs(N, K - 1, candidates, total - candidates[ind], ind, xxx, (c * K) // xxx[ind]) xxx[ind] -= 1 return ans xxx = [0] * len(candidates) answer = dfs(N, K, candidates, total, 0, xxx, 1) print(answer) if __name__ == "__main__": main()