Measuring WAC-ness

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Consider a string of length NN. Let string SS be that string repeated KK times. You are interested in how wack the string is, so your task is to find the WAC-ness of this string.

The WAC-ness of a string is the number of times "WAC" appears as a subsequence of that string.

A subsequence of a string is a string that can be derived from the given sequence by deleting zero or more characters without changing the order of the remaining characters. Two subsequences are different if at least one of the remaining indices are different. For example, in the string "AABC", the subsequence formed by indices 11, 33, and 44 is distinct from the subsequence formed by indices 22, 33, and 44.

As the answer can be very large, please output the answer modulo 998,244,353998\\,244\\,353.

입력

The first line will contain two integers, NN and KK (1N200,0001 \le N \le 200\\,000, 1K200,0001 \le K \le 200\\,000), the length of the original string and the number of times that string is repeated to form SS. The second and final line will contain the original string of NN characters, consisting of uppercase letters of the English alphabet.

출력

Output the WAC-ness of the string SS modulo 998,244,353998\\,244\\,353.