#include using namespace std; #define rep(i,a,b) for(int i=a;i d; vector enumdiv(int n) { vector S; for (int i = 1; i*i <= n; i++) if (n%i == 0) { S.push_back(i); if (i*i != n) S.push_back(n / i); } sort(S.begin(), S.end()); return S; } //----------------------------------------------------------------- int memo[1020][101][1020]; int f(int n, int m, int k) { // d[m]以上の数をk個使って、積をnとする組合せ if (k == 0 && n == 0) return 1; if (k == 0) return 0; if (n == 0) return 0; if (m == d.size()) return 0; if (0 <= memo[m][k][n]) return memo[m][k][n]; int ret = f(n, m + 1, k); int x = d[n], kk = k; while (x % d[m] == 0) { x /= d[m]; kk--; int nn = lower_bound(d.begin(), d.end(), x) - d.begin(); ret += f(nn, m + 1, kk); if (kk == 0) break; } return memo[m][k][n] = ret; } //----------------------------------------------------------------- int main() { cin >> N >> X; d = enumdiv(X + 1); rep(i, 0, 1020) rep(j, 0, 101) rep(k, 0, 1020) memo[i][j][k] = -1; cout << f(d.size() - 1, 1, N) << endl; }