#P3193. [HNOI2008] GT考试
[HNOI2008] GT考试
Description
Ashen is preparing to register for the GT Exam. His examinee number is an -digit sequence , and he does not want any unlucky number to appear in it. His unlucky number is an -digit sequence . “Does not appear” means that in there is no contiguous segment exactly equal to . Both and may be .
Input Format
The first line contains . The next line contains an -digit number.
Output Format
Ashen wants to know how many examinee numbers do not contain the unlucky number. Output the result modulo .
4 3 100
111
81
Hint
Constraints
For all testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号