【模板】矩阵快速幂
题目背景
一个 m × n m \times n m×n 的矩阵是一个由 m m m 行 n n n 列元素排列成的矩形阵列。即形如
A = [ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋱ ⋮ a m 1 a m 2 ⋯ a m n ] . A = [a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn]" role="presentation">⎡⎣⎢⎢⎢⎢⎢a11a21⋮am1a12a22⋮am2⋯⋯⋱⋯a1na2n⋮amn⎤⎦⎥⎥⎥⎥⎥
\text{.} A=⎣
⎡a11a21⋮am1a12a22⋮am2⋯⋯⋱⋯a1na2n⋮a