/* -*- coding: utf-8 -*- * * 2051.cc: No.2051 Divide - yukicoder */ #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int a, b; scanf("%d%d", &a, &b); int c = 0; for (int p = 1; p * p <= a; p++) if (a % p == 0) { int q = a / p; if (p % b == 0) c++; if (q != p && q % b == 0) c++; } printf("%d\n", c); return 0; }