#include<iostream>#include<algorithm>#include<map>#include<stdio.h>#include<string.h>#include<unordered_map>#include<vector>#include<queue>#include<set>#include<math.h>usingnamespace std;constint mod =998244353;typedeflonglong ll;//矩阵快速幂模板 struct mat
{
ll m[14][14];};
mat unit;
mat matmul(mat a,mat b)//c=矩阵a*矩阵b{
mat c;
ll tmp =0;for(int i=0;i<14;i++)for(int j=0;j<14;j++){
tmp=0;for(int k=0;k<14;k++){
tmp=(tmp+a.m[i][k]*b.m[k][j])%mod;}
c.m[i][j]=tmp;}return c;}struct mat QuickPow(struct mat a,ll n)//ans=矩阵a^n{for(int i=0;i<14;i++)
unit.m[i][i]=1;
mat ans=unit;while(n){if(n&1)
ans=matmul(ans,a);
a =matmul(a,a);
n>>=1;}return ans;}
带模矩阵快速幂模板#include<iostream>#include<algorithm>#include<map>#include<stdio.h>#include<string.h>#include<unordered_map>#include<vector>#include<queue>#include<set>#include<math.h>using na