This problem is in Contest(s) below:
Contest 1139:矩阵乘法,Kmp,扩展Kmp
Contest 1243:矩阵乘法&&高斯消元
Contest 1024:Noip备战1