#P1010. Sum of all digits

    ID: 23 传统题 1000ms 256MiB 尝试: 16 已通过: 4 难度: 9 上传者: 标签>福建师范大学第十八届程序设计竞赛正式赛

Sum of all digits

说明

R0 is very interested in numbers. His two favorite digits are $a$ and $b$. So if a positive integer wants to win his favor, this positive integer needs to be $a$ or $b$ in every digit, and the sum of all digits must be a multiple of $k$, because he thinks $k$ is a great divisor.

For example, let's say his favorite numbers are $1$ and $2$, and $k$ is $6$, then number $12$ or $221160$ can't meet the requirements, but numbers $1221$ can.

Now R0 is wondering, how many positive integer of length exactly $n$ are there can get his favor.

As this number can be rather large, he asks you to count the remainder after dividing it by $1000000007 (10^9 + 7)$.

输入格式

The only line contains four integers $a, b, k, n$ $(1 \le a < b \le 9 , 1\le k \le5000, 1 \le n \le 10^{6})$.

输出格式

Print the answer to the problem modulo $1000000007$ ($10^9 + 7$).

样例

1 2 6 2
0

样例

2 3 3 10
341