#P9501. Circular Sequence Product Sum

    ID: 22650 Type: Default 1000ms 256MiB

Circular Sequence Product Sum

Circular Sequence Product Sum

Consider a circular sequence a[0], a[1], ..., a[n-1] where each element is either +1 or -1. For a given integer m (1 ≤ m ≤ n), define the function:

S(a, m) = \(\displaystyle \sum_{k=0}^{n-1} \prod_{l=0}^{m-1} a_{(k+l) \bmod n}\)

Given three integers n, m, and k, your task is to determine the number of different sequences a (out of the 2n possible ones) that satisfy:

S(a, m) = k

Since the answer can be very large, output it modulo 998\,244\,353.

Note: The sequence is circular, i.e. indices are taken modulo n. All formulas are presented in LaTeX.

inputFormat

The input consists of a single line containing three integers n, m, and k, separated by spaces.

outputFormat

Output a single integer – the number of sequences a for which S(a, m) = k, taken modulo 998244353.

sample

3 1 1
3