atcoder#KEYENCE2021F. Keyence Repetition
Keyence Repetition
Score : points
Problem Statement
Let be the concatenation of copies of keyence.
Consider deleting zero or more characters from and concatenating the remaining characters without changing the order to make a new string .
There are ways to choose the positions at which we delete the characters. Among them, how many make equal to ? Find the count modulo .
Constraints
- is a string consisting of
c,e,k,n, andy.
Input
Input is given from Standard Input in the following format:
Output
Print the number of ways to choose the positions at which we delete the characters so that will be equal to , modulo .
2
key
6
- We have
keyencekeyence. - There are six ways to choose the positions at which we delete the characters so that
key.
2
ccc
0
- There are zero ways to choose the positions at which we delete the characters so that
ccc.
100
keyneeneeeckyycccckkke
275429980
- Be sure to find the count modulo .