Jjin Even Number
InterviewTime limit1sMemory limit1024 MB
Given N, count the N-digit Jjin Even Numbers (no leading zero, except 0 itself) modulo 10^9+7 for up to 100,000 queries.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Recently, Chito defined a unique kind of number called Jjin Even Number. A Jjin Even Number is a non-negative integer with digits in which every digit belongs to . Apart from 0 itself, numbers that start with 0, such as , are not considered. For example, and are Jjin Even Numbers, but and are not.
Minseong became curious about Jjin Even Numbers and wants to ask Chito questions. Each question has the following form:
- : the number of distinct Jjin Even Numbers among the non-negative integers with digits
Help Chito answer the questions.
Input
The first line contains a positive integer , the number of questions.
Each of the next lines contains a positive integer , the question to ask Chito.
Output
Print lines. On each line, print Chito's answer modulo .