#P7158. Even k-Digit Count in n-Digit Numbers

    ID: 20362 Type: Default 1000ms 256MiB

Even k-Digit Count in n-Digit Numbers

Even k-Digit Count in n-Digit Numbers

Given two integers n and k, where n represents the number of digits of a number and k is a digit from 0 to 9, count the number of n-digit numbers that satisfy the following conditions:

  1. No leading zeros (note that when n = 1, the single digit 0 is allowed since it does not count as having a leading zero).
  2. The total number of occurrences of the digit $k$ in the number is even (recall that 0 is even).

Output the answer modulo $998\,244\,353$.

inputFormat

The input consists of a single line containing two space-separated integers: n and k.

outputFormat

Output a single integer: the number of valid n-digit numbers modulo $998\,244\,353$.

sample

1 0
9