//快速冪 Matrix operator^(int x) { Matrix M, A; M.n[0][1] = 0, M.n[1][0] = 0; M.n[0][0] = 1, M.n[1][1] = 1; M.mod = mod; if (!x)return M; if (x == 1) return *this*M; A = *this; for (; x; x >>= 1, A = A * A) if (x & 1) M = M * A;
return M; }
Matrix operator=(Matrix m) { mod = m.mod; n[0][0] = m.n[0][0]; n[0][1] = m.n[0][1]; n[1][0] = m.n[1][0]; n[1][1] = m.n[1][1]; return *this; } }; intmain() { int n, m; while (scanf("%d%d", &n, &m) != EOF) { Matrix M; M.n[0][0] = 1; M.n[0][1] = 1; M.n[1][0] = 1; M.n[1][1] = 0; M.mod = 1 << m;