Lunar New Year and a Recursive Sequence(矩阵快速幂+BSGS)
F.LunarNewYearandaRecursiveSequence题意:给出f1=f2=⋯=fk−1=1f_1=f_2=\cdots=f_{k-1}=1f1=f2=⋯=fk−1=1和b1,b2⋯bkb_1,b_2\cdotsb_kb1,b2⋯bk,还有递推方程fi=fi−1b1fi−2b2⋯fi−kbkf_i=f_{i-1}^{b_1}f_{i-2}^{b_2}\cdotsf_{i-k}^{b