|
||||||||||
Kykneion asmaTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 588 Accepted Submission(s): 328 Problem Description On the last day before the famous mathematician Swan's death, he left a problem to the world: Given integers $n$ and $a_i$ for $0\leq i \leq 4$, calculate the number of $n$-digit integers which have at most $a_i$-digit $i$ in its decimal representation (and have no $5,6,7,8$ or $9$). Leading zeros are not allowed in this problem. Input There is one integer $T~(1<T\le 10)$ in the beginning of input, which means that you need to process $T$ test cases. In each test case, there is one line containing six integers representing $n$ and $a_0$ to $a_4$, where $2\leq n\leq 15000$ and $0\leq a_i\leq 30000$. Output For each test case, you should print first the identifier of the test case and then the answer to the problem, module $10^9+7$. Sample Input
Sample Output
Source | ||||||||||
|