#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int ddx[] = {2, 2, -2, -2, 1, 1, -1, -1}, ddy[] = {1, -1, 1, -1, 2, -2, 2, -2};
long long a[200005], b[200005], t[200005];
void fft(vector<complex<double> > &a, bool inv) {
  int n = a.size(), j = 0;
  vector<complex<double> > roots(n / 2);
  for (int i = 1; i < n; i++) {
    int bit = (n >> 1);
    while (j >= bit) {
      j -= bit;
      bit >>= 1;
    }
    j += bit;
    if (i < j) swap(a[i], a[j]);
  }
  double ang = 2 * acos(-1) / n * (inv ? -1 : 1);
  for (int i = 0; i < n / 2; i++) {
    roots[i] = complex<double>(cos(ang * i), sin(ang * i));
  }
  for (int i = 2; i <= n; i <<= 1) {
    int step = n / i;
    for (int j = 0; j < n; j += i) {
      for (int k = 0; k < i / 2; k++) {
        complex<double> u = a[j + k], v = a[j + k + i / 2] * roots[step * k];
        a[j + k] = u + v;
        a[j + k + i / 2] = u - v;
      }
    }
  }
  if (inv)
    for (int i = 0; i < n; i++) a[i] /= n;
}
vector<long long> multiply(vector<long long> &v, vector<long long> &w) {
  vector<complex<double> > fv(v.begin(), v.end()), fw(w.begin(), w.end());
  int n = 2;
  while (n < v.size() + w.size()) n <<= 1;
  fv.resize(n);
  fw.resize(n);
  fft(fv, 0);
  fft(fw, 0);
  for (int i = 0; i < n; i++) fv[i] *= fw[i];
  fft(fv, 1);
  vector<long long> ret(n);
  for (int i = 0; i < n; i++) ret[i] = (long long)round(fv[i].real());
  return ret;
}
vector<long long> multiply(vector<long long> &v, vector<long long> &w,
                           long long MOD) {
  int n = 2;
  while (n < v.size() + w.size()) n <<= 1;
  vector<complex<double> > v1(n), v2(n), r1(n), r2(n);
  for (int i = 0; i < v.size(); i++) {
    v1[i] = complex<double>(v[i] >> 15, v[i] & 32767);
  }
  for (int i = 0; i < w.size(); i++) {
    v2[i] = complex<double>(w[i] >> 15, w[i] & 32767);
  }
  fft(v1, 0);
  fft(v2, 0);
  for (int i = 0; i < n; i++) {
    int j = (i ? (n - i) : i);
    complex<double> ans1 = (v1[i] + conj(v1[j])) * complex<double>(0.5, 0);
    complex<double> ans2 = (v1[i] - conj(v1[j])) * complex<double>(0, -0.5);
    complex<double> ans3 = (v2[i] + conj(v2[j])) * complex<double>(0.5, 0);
    complex<double> ans4 = (v2[i] - conj(v2[j])) * complex<double>(0, -0.5);
    r1[i] = (ans1 * ans3) + (ans1 * ans4) * complex<double>(0, 1);
    r2[i] = (ans2 * ans3) + (ans2 * ans4) * complex<double>(0, 1);
  }
  fft(r1, 1);
  fft(r2, 1);
  vector<long long> ret(n);
  for (int i = 0; i < n; i++) {
    long long av = (long long)round(r1[i].real());
    long long bv =
        (long long)round(r1[i].imag()) + (long long)round(r2[i].real());
    long long cv = (long long)round(r2[i].imag());
    av %= MOD, bv %= MOD, cv %= MOD;
    ret[i] = (av << 30) + (bv << 15) + cv;
    ret[i] %= MOD;
    ret[i] += MOD;
    ret[i] %= MOD;
  }
  return ret;
}
vector<long long> go(int S, int E) {
  if (S == E) {
    vector<long long> res = {1};
    res.push_back(b[S]);
    return res;
  }
  vector<long long> L = go(S, S + E >> 1), R = go((S + E >> 1) + 1, E);
  return multiply(L, R, MOD);
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int(i) = (1); (i) <= (n); (i) += (1)) scanf("%lld", a + i);
  int Q;
  scanf("%d", &Q);
  while (Q--) {
    int o, q, x, y, z;
    scanf("%d%d%d%d", &o, &q, &x, &y);
    if (o == 1) {
      for (int(i) = (1); (i) <= (n); (i) += (1)) t[i] = a[i];
      t[x] = y;
    } else {
      scanf("%d", &z);
      for (int(i) = (1); (i) <= (n); (i) += (1)) t[i] = a[i];
      for (int(i) = (x); (i) <= (y); (i) += (1)) t[i] += z;
    }
    for (int(i) = (1); (i) <= (n); (i) += (1)) {
      b[i] = (q - t[i]) % MOD;
      if (b[i] < 0) b[i] += MOD;
    }
    vector<long long> v = go(1, n);
    printf("%lld\n", v[k]);
  }
}

### Prompt

Please provide a CPP coded solution to the problem described below:

While roaming the mystic areas of Stonefalls, in order to drop legendary loot, an adventurer was given a quest as follows. He was given an array A = {a_1,a_2,...,a_N } of length N, and a number K.

Define array B as B(q, A) =  { q-a_1, q-a_2, ..., q-a_N }. Define function F as F(B,K) being sum of products of all K-tuples of elements in array B. For example, if the array B is [2,3,4,5], and with K=3, sum of products of all 3-tuples is $$$F(B, 3) = 2*3*4+2*3*5+3*4*5+2*4*5$$$

He was then given a number Q, number of queries of two types: 

  * Type 1: Given q, i, and d calculate F(B(q, A), K) where we make change to initial array as A[i] = d. 
  * Type 2: Given q, L, R, and d calculate F(B(q, A), K) where we make change to initial array as A[i] = A[i] + d for all i in range [L, R] inclusive. 



All changes are temporarily made to initial array, and don't propagate to following queries. Help the adventurer calculate the answer to a quest, and finally get that loot!

Input

In the first two lines, numbers N (1 ≤ N ≤ 2*10^4) and K (1 ≤ K ≤ N), the length of initial array A, and tuple size, followed by a_1,a_2,a_3,…,a_N (0 ≤ a_i ≤ 10^9) , elements of array A, in the next line. Then follows number Q (Q ≤ 10), number of queries. In the next Q lines come queries of the form: 

  * 1 q i d, for type 1, 
  * 2 q L R d, for type 2, 



as explained above (0 ≤ q, d ≤ 10^9, 1 ≤ i,L,R ≤ N)

Output

Print Q lines, the answers to queries, modulo 998244353.

Example

Input


5
2
1 2 3 4 5
3
1 6 1 1
1 6 5 2
2 6 2 3 1


Output


85
127
63

Note

In the first query array A = [1, 2, 3, 4, 5], B = [5, 4, 3, 2, 1], sum of products of 2-tuples = 85.

In second query array A = [1, 2, 3, 4, 2], B = [5, 4, 3, 2, 4], sum of products of 2-tuples = 127

In third query array A = [1, 3, 4, 4, 5], B = [5, 3, 2, 2, 1], sum of products of 2-tuples = 63

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int ddx[] = {2, 2, -2, -2, 1, 1, -1, -1}, ddy[] = {1, -1, 1, -1, 2, -2, 2, -2};
long long a[200005], b[200005], t[200005];
void fft(vector<complex<double> > &a, bool inv) {
  int n = a.size(), j = 0;
  vector<complex<double> > roots(n / 2);
  for (int i = 1; i < n; i++) {
    int bit = (n >> 1);
    while (j >= bit) {
      j -= bit;
      bit >>= 1;
    }
    j += bit;
    if (i < j) swap(a[i], a[j]);
  }
  double ang = 2 * acos(-1) / n * (inv ? -1 : 1);
  for (int i = 0; i < n / 2; i++) {
    roots[i] = complex<double>(cos(ang * i), sin(ang * i));
  }
  for (int i = 2; i <= n; i <<= 1) {
    int step = n / i;
    for (int j = 0; j < n; j += i) {
      for (int k = 0; k < i / 2; k++) {
        complex<double> u = a[j + k], v = a[j + k + i / 2] * roots[step * k];
        a[j + k] = u + v;
        a[j + k + i / 2] = u - v;
      }
    }
  }
  if (inv)
    for (int i = 0; i < n; i++) a[i] /= n;
}
vector<long long> multiply(vector<long long> &v, vector<long long> &w) {
  vector<complex<double> > fv(v.begin(), v.end()), fw(w.begin(), w.end());
  int n = 2;
  while (n < v.size() + w.size()) n <<= 1;
  fv.resize(n);
  fw.resize(n);
  fft(fv, 0);
  fft(fw, 0);
  for (int i = 0; i < n; i++) fv[i] *= fw[i];
  fft(fv, 1);
  vector<long long> ret(n);
  for (int i = 0; i < n; i++) ret[i] = (long long)round(fv[i].real());
  return ret;
}
vector<long long> multiply(vector<long long> &v, vector<long long> &w,
                           long long MOD) {
  int n = 2;
  while (n < v.size() + w.size()) n <<= 1;
  vector<complex<double> > v1(n), v2(n), r1(n), r2(n);
  for (int i = 0; i < v.size(); i++) {
    v1[i] = complex<double>(v[i] >> 15, v[i] & 32767);
  }
  for (int i = 0; i < w.size(); i++) {
    v2[i] = complex<double>(w[i] >> 15, w[i] & 32767);
  }
  fft(v1, 0);
  fft(v2, 0);
  for (int i = 0; i < n; i++) {
    int j = (i ? (n - i) : i);
    complex<double> ans1 = (v1[i] + conj(v1[j])) * complex<double>(0.5, 0);
    complex<double> ans2 = (v1[i] - conj(v1[j])) * complex<double>(0, -0.5);
    complex<double> ans3 = (v2[i] + conj(v2[j])) * complex<double>(0.5, 0);
    complex<double> ans4 = (v2[i] - conj(v2[j])) * complex<double>(0, -0.5);
    r1[i] = (ans1 * ans3) + (ans1 * ans4) * complex<double>(0, 1);
    r2[i] = (ans2 * ans3) + (ans2 * ans4) * complex<double>(0, 1);
  }
  fft(r1, 1);
  fft(r2, 1);
  vector<long long> ret(n);
  for (int i = 0; i < n; i++) {
    long long av = (long long)round(r1[i].real());
    long long bv =
        (long long)round(r1[i].imag()) + (long long)round(r2[i].real());
    long long cv = (long long)round(r2[i].imag());
    av %= MOD, bv %= MOD, cv %= MOD;
    ret[i] = (av << 30) + (bv << 15) + cv;
    ret[i] %= MOD;
    ret[i] += MOD;
    ret[i] %= MOD;
  }
  return ret;
}
vector<long long> go(int S, int E) {
  if (S == E) {
    vector<long long> res = {1};
    res.push_back(b[S]);
    return res;
  }
  vector<long long> L = go(S, S + E >> 1), R = go((S + E >> 1) + 1, E);
  return multiply(L, R, MOD);
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int(i) = (1); (i) <= (n); (i) += (1)) scanf("%lld", a + i);
  int Q;
  scanf("%d", &Q);
  while (Q--) {
    int o, q, x, y, z;
    scanf("%d%d%d%d", &o, &q, &x, &y);
    if (o == 1) {
      for (int(i) = (1); (i) <= (n); (i) += (1)) t[i] = a[i];
      t[x] = y;
    } else {
      scanf("%d", &z);
      for (int(i) = (1); (i) <= (n); (i) += (1)) t[i] = a[i];
      for (int(i) = (x); (i) <= (y); (i) += (1)) t[i] += z;
    }
    for (int(i) = (1); (i) <= (n); (i) += (1)) {
      b[i] = (q - t[i]) % MOD;
      if (b[i] < 0) b[i] += MOD;
    }
    vector<long long> v = go(1, n);
    printf("%lld\n", v[k]);
  }
}

```