1580.The Digits String

Time Limit: 1s Memory Limit: 256MB

Consider digits strings with length $n$, how many different strings have the sum of digits are multiple of $4$?

Input Format(From the terminal/stdin)

There are several test cases end with EOF. For each test case, there is an integer in one line: $n$, the
length of the digits string. $(1≤n≤1,000,000,000)$.

Output Format(To the terminal/stdout)

For each case, output the number of digits strings with length $n$ have the sum of digits are
multiple of $4$ in one line. The numbers maybe very large, you should output the result modula
$2019$.

Sample Input

Copy
1
2
3
4
 \n
 \n
 \n
 \n

Sample Output

Copy
3
25
249
479
 \n
  \n
   \n
   \n
Source: 2018 HNU新生赛

Submit

请先 登录

© 2025 FAQs