func_code_string: #include <bits/stdc++.h>   using namespace std;   const double eps = 1e-8;   const double pi = acos(-1.0);   template <class T>   long long chkmin(T &a, T b) {     return a > b ? a = b, 1 : 0;   }   template <class T>   long long chkmax(T &a, T b) {     return a < b ? a = b, 1 : 0;   }   template <class T>   T sqr(T a) {     return a * a;   }   template <class T>   T mmin(T a, T b) {     return a < b ? a : b;   }   template <class T>   T mmax(T a, T b) {     return a > b ? a : b;   }   template <class T>   T aabs(T a) {     return a < 0 ? -a : a;   }   template <class T>   long long dcmp(T a, T b) {     return a > b;   }   template <long long *a>   long long cmp_a(long long first, long long second) {     return a[first] < a[second];   }   namespace io {   const long long SIZE = (1 << 21) + 1;   char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c,                                          qu[55];   long long f, qr;   inline void flush() {     fwrite(obuf, 1, oS - obuf, stdout);     oS = obuf;   }   inline void putc(char first) {     *oS++ = first;     if (oS == oT) flush();   }   inline bool read(signed &first) {     for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                                 (iS == iT ? EOF : *iS++))                               : *iS++);          c <  0  || c >  9 ;          c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                          (iS == iT ? EOF : *iS++))                        : *iS++))       if (c ==  - )         f = -1;       else if (c == EOF)         return 0;     for (first = 0; c <=  9  && c >=  0 ;          c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                          (iS == iT ? EOF : *iS++))                        : *iS++))       first = first * 10 + (c & 15);     first *= f;     return 1;   }   inline bool read(long long &first) {     for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                                 (iS == iT ? EOF : *iS++))                               : *iS++);          c <  0  || c >  9 ;          c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                          (iS == iT ? EOF : *iS++))                        : *iS++))       if (c ==  - )         f = -1;       else if (c == EOF)         return 0;     for (first = 0; c <=  9  && c >=  0 ;          c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                          (iS == iT ? EOF : *iS++))                        : *iS++))       first = first * 10 + (c & 15);     first *= f;     return 1;   }   inline bool read(char &first) {     first = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                          (iS == iT ? EOF : *iS++))                       : *iS++);     return first != EOF;   }   inline bool read(char *first) {     while ((*first = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                                   (iS == iT ? EOF : *iS++))                                : *iS++)) ==   n  ||            *first ==     || *first ==   r )       if (*first == EOF) return 0;     while (!(*first ==   n  || *first ==     || *first ==   r  || *first == EOF))       *(++first) = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),                                 (iS == iT ? EOF : *iS++))                              : *iS++);     *first = 0;     return 1;   }   template <typename A, typename... B>   inline bool read(A &first, B &...second) {     return read(first) && read(second...);   }   inline bool write(signed first) {     if (!first) putc( 0 );     if (first < 0) putc( - ), first = -first;     while (first) qu[++qr] = first % 10 +  0 , first /= 10;     while (qr) putc(qu[qr--]);     return 0;   }   inline bool write(long long first) {     if (!first) putc( 0 );     if (first < 0) putc( - ), first = -first;     while (first) qu[++qr] = first % 10 +  0 , first /= 10;     while (qr) putc(qu[qr--]);     return 0;   }   inline bool write(char first) {     putc(first);     return 0;   }   inline bool write(const char *first) {     while (*first) {       putc(*first);       ++first;     }     return 0;   }   inline bool write(char *first) {     while (*first) {       putc(*first);       ++first;     }     return 0;   }   template <typename A, typename... B>   inline bool write(A first, B... second) {     return write(first) || write(second...);   }   struct Flusher_ {     ~Flusher_() { flush(); }   } io_flusher_;   }  // namespace io   using io ::putc;   using io ::read;   using io ::write;   long long inf;   struct _init_ {     _init_() { memset(&inf, 0x3f, sizeof(inf)); }   };   _init_ ___INIT__;   long long a[20005], b[20005];   long long f[40005], beg[20005];   vector<long long> poly[40005];   long long t;   const long long p = 998244353, g = 3;   long long rev[1 << 18];   long long fpm(long long a, long long b) {     long long c = 1;     for (; b; b >>= 1, a = a * a % p)       if (b & 1) c = c * a % p;     return c;   }   void NTT(vector<long long> &a, long long n, long long flg) {     for (long long i = 0; i < n; ++i) {       rev[i] = (rev[i >> 1] >> 1) | ((i & 1) * (n >> 1));       if (i < rev[i]) swap(a[i], a[rev[i]]);     }     for (long long i = 1; i < n; i <<= 1) {       long long ww = fpm(g, (p - 1) / i / 2 * (flg + p - 1)), w;       for (long long j = 0; j < n; j += i + i) {         w = 1;         for (long long k = 0; k < i; ++k) {           long long u = a[j + k], v = a[j + k + i] * w % p;           a[j + k] = (u + v) % p;           a[j + k + i] = (u - v + p) % p;           w = w * ww % p;         }       }     }     if (flg == -1) {       long long in = fpm(n, p - 2);       for (long long i = 0; i < n; ++i) a[i] = a[i] * in % p;     }   }   void Prod(vector<long long> &a, vector<long long> &b, vector<long long> &c) {     long long first = a.size() + b.size(), n = 1;     while (n < first) n <<= 1;     a.resize(n);     b.resize(n);     c.resize(n);     NTT(a, n, 1);     NTT(b, n, 1);     for (long long i = 0; i < n; ++i) c[i] = a[i] * b[i] % p;     NTT(c, n, -1);     c.resize(first - 1);     a.clear();     b.clear();   }   long long query(long long k) {     long long l = 1;     while (l < t) {       Prod(poly[l], poly[l + 1], poly[++t]);       l += 2;     }     return poly[t][k];   }   signed main() {     long long n, k;     read(n, k);     for (long long i = 1; i <= n; ++i) read(a[i]);     long long q;     long long tp, first, l, r, d;     read(q);     for (; q; --q) {       read(tp, first, l);       if (tp == 1) {         read(d);         for (long long i = 1; i <= n; ++i) {           poly[i].clear();           poly[i].push_back(1);           poly[i].push_back((first - (i == l ? d : a[i]) + 2 * p) % p);         }       } else {         read(r, d);         for (long long i = 1; i <= n; ++i) {           poly[i].clear();           poly[i].push_back(1);           poly[i].push_back((first - a[i] + 2 * p) % p);         }         for (long long i = l; i <= r; ++i)           poly[i][1] = (poly[i][1] + 2 * p - d) % p;       }       t = n;       write(query(k),   n );     }     return 0;   }   