#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <stack>
typedef long long ll;
using namespace std;
const int N = 1e5 + 67;
const int K = 2048;
#define all(X) X.begin(), X.end()
#define UNIQUE(x) sort(all(x)), (x).erase(unique(all(x)), (x).end())
int a[N];
struct fenwick
{
ll f[N];
int n;
void init(int _n)
{
n = _n;
for (int i = 0; i <= n; i++)f[i] = 0;
}
void add(int pos, ll val)
{
for (; pos <= n; pos += pos & -pos)
f[pos] += val;
}
ll sm(ll l, ll r)
{
if (l > r)return 0ll;
return qry(r) - qry(l - 1);
}
ll qry(int pos)
{
ll ans = 0;
for (pos; pos >= 1; pos -= pos & -pos)
ans += f[pos];
return ans;
}
};
int p_[N];
ll p[N];
fenwick f1, f2;
void solve()
{
int n, k;
cin >> n >> k;
f1.init(n);
f2.init(n);
for (int i = 1; i <= n; i++)
{
cin >> a[i];
f1.add(i, 1ll * a[i]);
p[i] = p[i - 1] + a[i];
}
for (int i = 1; i <= n; i++)f2.add(i, f1.qry(i));
int q;
cin >> q;
while (q--)
{
int t;
cin >> t;
if (t == 1)
{
for (int i = 1; i <= k; i++)cin >> p[i];
}
else
{
int l, r, m;
cin >> l >> r >> m;
ll ans = 0;
ans += f2.sm(l + m - 1, r);
ans -= f2.sm(l - 1, r - m);
cout << ans << endl;
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int t = 1;
//cin >> t;
while(t--)
solve();
return 0;
}