CF284 Div1 E Stairs and Lines

Problem - E - Codeforces
本質は定数倍改善。
7個の行列をそれぞれ行列累乗して掛けるだけ