#include #include using namespace std; using ll=long long; using mint=atcoder::modint998244353; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N,M,K; cin>>N>>M>>K; vectorC(K); for(int i=0;i>C[i]; vectordp(2*N+6); dp[0]=1; for(int i=1;i<=2*N+5;i++){ for(int j=1;j<=6;j++){ if(0<=i-j&&i-j<2*N)dp[i]+=dp[i-j]; } } vectorpd(N+6); for(int i=0;i<6;i++)pd[N+i]=1; for(int i=N-1;i>=0;i--){ for(int j=1;j<=6;j++)pd[i]+=pd[i+j]; } mint al=0; for(int i=0;i<6;i++)al+=dp[2*N+i]; for(int i=0;i=0){ for(int l=1;l<=5;l++){ for(int m=l+1;m<=6;m++){ if(c-j+k<=N+c-l){ ans+=dp[c-j]*dp[(N+c-l)-(c-j+k)]*pd[c-l+m]; } } } } } } ans=al-ans; cout<