Problem: As we all know, Dart is some kind of creature from Upside Down world. For simplicity, we call their kind pollywogs. Dart and x - 1 other pollywogs are playing a game. There are n stones in a row, numbered from 1 through n from left to right. At most 1 pollywog may be sitting on each stone at a time. Initially, the pollywogs are sitting on the first x stones (one pollywog on each stone).

<image>

Dart and his friends want to end up on the last x stones. At each second, the leftmost pollywog should jump to the right. A pollywog can jump at most k stones; more specifically, a pollywog can jump from stone number i to stones i + 1, i + 2, ... i + k. A pollywog can't jump on an occupied stone. Jumping a distance i takes ci amounts of energy from the pollywog. 

Also, q stones are special Each time landing on a special stone p, takes wp amounts of energy (in addition to the energy for jump) from the pollywog. wp could be negative, in this case, it means the pollywog absorbs |wp| amounts of energy.

Pollywogs want to spend as little energy as possible (this value could be negative). 

They're just pollywogs, so they asked for your help. Tell them the total change in their energy, in case they move optimally.

Input

The first line of input contains four integers, x, k, n and q (1 ≤ x ≤ k ≤ 8, k ≤ n ≤ 108, 0 ≤ q ≤ min(25, n - x)) — the number of pollywogs, the maximum length of jump, the number of stones and the number of special stones.

The next line contains k integers, c1, c2, ... ck, separated by spaces (1 ≤ ci ≤ 109) — the energetic costs of jumps.

The next q lines contain description of the special stones. Each line contains two integers p and wp (x + 1 ≤ p ≤ n, |wp| ≤ 109). All p are distinct.

Output

Print the minimum amount of energy they need, in the first and only line of output.

Examples

Input

2 3 10 2
1 2 3
5 -10
6 1000


Output

6


Input

4 7 85 3
17 5 28 4 52 46 6
59 -76
33 -69
19 2018


Output

135

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
void qread(int &x) {
  int neg = 1;
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = 10 * x + c - '0', c = getchar();
  x *= neg;
}
const int maxn = 300;
int x, k, n, q, sz;
long long c[maxn];
long long dp[maxn][maxn], cur[maxn];
pair<int, long long> z[maxn];
int ind[maxn];
vector<int> v;
map<int, long long> spe;
void ckmin(long long &a, long long b) { a = a < b ? a : b; }
class Matrix {
 public:
  long long m[75][75];
  Matrix() { memset(m, 0, sizeof(m)); }
  Matrix operator*(const Matrix &o) const {
    Matrix res;
    for (int(i) = 0; (i) < sz; i++)
      for (int(j) = 0; (j) < sz; j++) {
        res.m[i][j] = 1e18;
        for (int(k) = 0; (k) < sz; k++) ckmin(res.m[i][j], m[i][k] + o.m[k][j]);
      }
    return res;
  }
} trans;
Matrix quickpow(Matrix x, int pow) {
  Matrix res;
  for (int(i) = 0; (i) < sz; i++)
    for (int(j) = 0; (j) < sz; j++)
      if (i != j) res.m[i][j] = 1e18;
  for (; pow; pow >>= 1) {
    if (pow & 1) res = res * x;
    x = x * x;
  }
  return res;
}
int main() {
  scanf("%d%d%d%d", &x, &k, &n, &q);
  for (int(i) = 1; (i) <= k; i++) scanf("%I64d", &c[i]);
  for (int(i) = 0; (i) < q; i++)
    scanf("%d%I64d", &z[i].first, &z[i].second), spe[z[i].first] = z[i].second;
  sort(z, z + q);
  for (int(mask) = 0; (mask) < 1 << k; mask++) {
    int c = 0;
    for (int(i) = 0; (i) < k; i++)
      if (mask & (1 << i)) c++;
    if (c == x) ind[mask] = v.size(), v.push_back(mask);
  }
  sz = v.size();
  for (int(i) = 0; (i) < sz; i++)
    for (int(j) = 0; (j) < sz; j++) trans.m[i][j] = 1e18;
  for (int(i) = 0; (i) < sz; i++) {
    int mask = v[i];
    cur[i] = 1e18;
    if (mask == ((1 << x) - 1) << k - x) cur[i] = 0;
    if (mask & (1 << k - 1)) {
      mask ^= (1 << k - 1);
      for (int(j) = 0; (j) < k - 1; j++)
        if (!(mask & (1 << j))) {
          trans.m[ind[(mask | (1 << j)) << 1]][i] = c[k - 1 - j];
        }
      trans.m[ind[mask << 1 | 1]][i] = c[k];
    } else
      trans.m[ind[mask << 1]][i] = 0;
  }
  int last = 1;
  for (int(i) = 0; (i) < q; i++) {
    int pos = z[i].first;
    Matrix now;
    for (int(j) = 0; (j) < sz; j++) now.m[j][0] = cur[j];
    now = quickpow(trans, max(pos - k - last, 0)) * now;
    int r = i;
    while (r < q && (r == i || z[r].first - z[r - 1].first < k)) r++;
    int en = min(n - x + 1, z[r - 1].first);
    last = max(pos - k, last);
    for (int j = last; j <= en; j++)
      for (int(s) = 0; (s) < sz; s++) dp[j - last][s] = 1e18;
    for (int(s) = 0; (s) < sz; s++) dp[0][s] = now.m[s][0];
    for (int j = last; j <= en; j++)
      for (int(s) = 0; (s) < sz; s++) {
        int mask = v[s];
        long long tmp = dp[j - last][s];
        if (tmp == 1e18) continue;
        if (mask & (1 << k - 1)) {
          mask ^= (1 << k - 1);
          for (int(p) = 0; (p) < k - 1; p++)
            if (!(mask & (1 << p))) {
              long long cost = tmp + c[k - 1 - p];
              if (spe.count(j + k - 1 - p)) cost += spe[j + k - 1 - p];
              ckmin(dp[j - last + 1][ind[(mask | (1 << p)) << 1]], cost);
            }
          long long cost = tmp + c[k];
          if (spe.count(j + k)) cost += spe[j + k];
          ckmin(dp[j - last + 1][ind[mask << 1 | 1]], cost);
        } else
          ckmin(dp[j - last + 1][ind[mask << 1]], tmp);
      }
    for (int(s) = 0; (s) < sz; s++) cur[s] = dp[en - last][s];
    last = en;
    i = r - 1;
  }
  Matrix now;
  for (int(j) = 0; (j) < sz; j++) now.m[j][0] = cur[j];
  Matrix other = trans * trans;
  now = quickpow(trans, max(n - x + 1 - last, 0)) * now;
  printf("%I64d\n", now.m[ind[((1 << x) - 1) << k - x]][0]);
  return 0;
}