Counting non-decreasing digit sequences
Time limit1sMemory limit128 MB
Count length-N non-decreasing sequences of digits 0 to 9, modulo 1000000007, for each test case.
- Level
Easy3 of 10
- Topics
- Combinatorics, Number theory
- Solved
- No attempts yet
Problem
Yasser is an Egyptian coach, and he is running a training camp in Jordan. On the last day the participants solved every hard problem he had brought, so he gave them one more task.
Count the sequences of digits, each one between 0 and 9, that satisfy . A sequence whose first digit is 0 counts as well.
Input
The first line contains the number of test cases . ()
Each of the next lines contains one integer . ()
Output
For each test case, print the number of valid sequences modulo on its own line.