#Q226. 「一本通 6.5 练习 2」GT 考试
「一本通 6.5 练习 2」GT 考试
Description
Original source: HNOI 2008
Ashen is preparing to register for the GT exam. The admission ticket number is an -digit number . He does not want any unlucky digits to appear on his ticket number.
His unlucky number is an -digit number . The ticket number is considered unlucky if it contains any contiguous subsequence exactly equal to . Note that and can be .
Input Format
The first line contains three integers . The next line contains the -digit unlucky number.
Output Format
Ashen wants to know how many ticket numbers do not contain the unlucky number. Output the result modulo .
Sample 1
4 3 100
111
81
Data Range and Hint
For all data, .