ll@n,@m,@l,@k,@b; modint().setmod(b); Matrixa(l,l); a=0; a[0..l-2][1..]=1; a[l-1][0]=1; Matrixe(l,l); e=1; Matrixc=((a+e)*m)**n; wt(c[0][k]);