# Include <iostream> # include <cstring> # include <cstdio> using namespace STD; const int mod = 1000000007; int DP [2] [1010] [1010]; int num [1000], LCM [1010] [1010]; int gcd (int A, int B) {If (B = 0) return a; return gcd (B, A % B);} int lcm (int A, int B) {return a/gcd (a, B) * B;} int main () {int n, m, k; int I, j, T, P; for (I = 1; I <= 1000; I ++) for (j = 1; j <= 1000; j ++) LCM [I] [J] = lcm (I, j); While (scanf ("% d", & N, & M, & K )! = EOF) {int CNT = 0; for (I = 1; I <= m; I ++) if (M % I = 0) num [CNT ++] = I; int now = 0; for (I = 0; I <= N; I ++) for (j = 0; j <CNT; j ++) DP [now] [I] [num [J] = 0; DP [now] [0] [1] = 1; for (t = 1; T <= K; t ++) {now ^ = 1; for (I = 0; I <= N; I ++) for (j = 0; j <CNT; j ++) DP [now] [I] [num [J] = 0; for (I = T-1; I <= N; I ++) for (j = 0; j <CNT; j ++) {If (DP [now ^ 1] [I] [num [J] = 0) continue; for (P = 0; P <CNT; P ++) {int x = I + num [p]; int y = LCM [num [J] [num [p]; If (x> N | M % Y! = 0) continue; DP [now] [x] [Y] + = DP [now ^ 1] [I] [num [J]; DP [now] [x] [Y] % = mod ;}} printf ("% d \ n", DP [now] [N] [m]);} return 0 ;}