Melborp Lacissalc
시간 제한2초메모리 제한1024 MB
0부터 k-1까지의 값을 원소로 하는 길이 n 배열 중, 합이 k의 배수가 되는 연속 부분배열의 개수가 정확히 t인 배열의 수를 998244353으로 나눈 나머지를 구합니다.
문제
Grammy has a favorite number . She thinks that all the numbers divisible by are good.
For each array containing only numbers from to , Grammy defines its goodness as the number of non-empty consecutive subarrays that sum to a good number.
Please count the number of arrays of length such that their goodness is . Since the answer can be enormous, output the answer modulo .
입력
A single line contains three integers , , (, ).
출력
Output a single integer denoting the answer modulo .