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>
using namespace std;
inline int getint() {
  int a = 0, b = 1, c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') b = -b;
  for (; isdigit(c); c = getchar()) a = (a << 3) + (a << 1) + (c ^ 48);
  return a * b;
}
const int maxn = 75;
const long long inf = 1e18;
vector<int> id;
map<int, int> cst;
int X, K, N, Q, C[maxn], P[maxn], getid[maxn << 2];
struct mat {
  long long a[maxn][maxn];
  mat() {
    for (int i = 0; i < int(maxn); ++i)
      for (int j = 0; j < int(maxn); ++j) a[i][j] = inf << 2;
  }
  void print() {
    for (int i = 0; i < int((int)id.size()); ++i) {
      for (int j = 0; j < int((int)id.size()); ++j) {
        if (a[i][j] < inf)
          printf("%5lld", a[i][j]);
        else
          printf("  inf");
      }
      printf("\n");
    }
  }
};
mat operator*(const mat &x, const mat &y) {
  mat z;
  for (int i = 0; i < int(maxn); ++i)
    for (int j = 0; j < int(maxn); ++j)
      for (int k = 0; k < int(maxn); ++k) {
        z.a[i][j] = min(z.a[i][j], x.a[i][k] + y.a[k][j]);
      }
  return z;
}
mat qp(mat x, int n) {
  mat ans;
  for (int i = 0; i < int(maxn); ++i) ans.a[i][i] = 0;
  for (; n; n >>= 1, x = x * x)
    if (n & 1) ans = ans * x;
  return ans;
}
mat a;
int main() {
  X = getint(), K = getint(), N = getint(), Q = getint();
  for (int i = 0; i < int(K); ++i) C[i] = getint();
  for (int i = 0; i < int(Q); ++i) {
    P[i] = getint() - 1;
    int x = getint();
    cst[P[i]] = x;
  }
  P[Q++] = 0;
  P[Q++] = N - K;
  sort(P, P + Q);
  for (int msk = 0; msk < int(1 << K); ++msk) {
    if (__builtin_popcount(msk) != X) continue;
    id.push_back(msk);
    getid[msk] = (int)id.size() - 1;
  }
  for (int msk = 0; msk < int(1 << K); ++msk) {
    if (__builtin_popcount(msk) != X) continue;
    int id1 = getid[msk];
    if (msk & 1) {
      for (int i = 0; i < int(K); ++i) {
        if ((msk >> 1) & (1 << i)) continue;
        int msk1 = (msk >> 1) | (1 << i);
        int id2 = getid[msk1];
        a.a[id1][id2] = min(a.a[id1][id2], 1LL * C[i]);
      }
    } else {
      int msk1 = msk >> 1;
      int id2 = getid[msk1];
      a.a[id1][id2] = 0;
    }
  }
  int pre = 0;
  mat ans;
  for (int i = 0; i < int(maxn); ++i) ans.a[i][i] = 0;
  for (int i = 0; i < int(Q); ++i) {
    if (P[i] > N - K) break;
    int nw = P[i] - K;
    if (pre < nw) {
      ans = ans * qp(a, nw - pre);
      pre = nw;
    }
    for (; pre < P[i]; ++pre) {
      mat b;
      for (int x = 0; x < int(maxn); ++x)
        for (int y = 0; y < int(maxn); ++y) {
          b.a[x][y] = a.a[x][y];
        }
      for (int msk = 0; msk < int(1 << K); ++msk) {
        if (__builtin_popcount(msk) != X) continue;
        int id1 = getid[msk];
        if (msk & 1) {
          for (int j = 0; j < int(K); ++j) {
            if ((msk >> 1) & (1 << j)) continue;
            int msk1 = (msk >> 1) | (1 << j);
            int id2 = getid[msk1];
            b.a[id1][id2] += cst[j + 1 + pre];
          }
        }
      }
      ans = ans * b;
    }
  }
  mat c;
  for (int i = 0; i < int(maxn); ++i) c.a[i][i] = 0;
  for (int msk = 0; msk < int(1 << K); ++msk) {
    if (__builtin_popcount(msk) != X) continue;
    int id1 = getid[msk];
    int lst = __builtin_ctz(msk);
    for (int nw = lst + 1; nw < K; ++nw) {
      if (msk & 1 << nw) continue;
      int nwmsk = msk ^ (1 << nw) ^ (1 << lst);
      int id2 = getid[nwmsk];
      c.a[id1][id2] = C[nw - lst - 1] + cst[N - K + nw];
    }
  }
  ans = ans * qp(c, K - X);
  printf(
      "%lld"
      "\n",
      ans.a[0][(int)id.size() - 1]);
  return 0;
}