codeforces 1117D Magic Gems(矩阵快速幂或杜教BM)

NoSuchKey