Numbers
Medium
Execution time limit is 2 seconds
Runtime memory usage limit is 32 megabytes
Given three integers (N), (a), and (b), your task is to determine the remainder when the count of natural numbers (X) that meet the following conditions is divided by (1000000007) ((10^9+7)):
(X N);
(X) is divisible by (2^a);
The sum of the digits of (X) is divisible by (2^b).
Input
The first line of the input contains two integers: (a) and (b) ((0 a 9), (0 b 9)).
The second line contains the integer (N) ((1 N 10^5000)).
Output
The output should be a single number: the remainder when the count of natural numbers (X) that satisfy all the conditions above is divided by (1000000007) ((10^9+7)).
Examples
Input #1
Answer #1
Submissions 86
Acceptance rate 8%