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;
const int maxk = 10, maxn = 1e8 + 10, maxc = 260, maxs = 80, maxq = 30,
          maxp = 30;
const long long oo = 1LL << 60;
long long t[maxs][maxs];
inline long long myMin(long long a, long long b) { return (a < b) ? a : b; }
inline int myMax(int a, int b) { return (a > b) ? a : b; }
struct mat {
  int r, c;
  long long m[maxs][maxs];
  void mul(const mat& B) {
    int i, j, k;
    for (i = (1); i <= (r); i++) {
      for (j = (1); j <= (B.c); j++) {
        t[i][j] = oo;
      }
    }
    for (i = (1); i <= (r); i++) {
      for (k = (1); k <= (c); k++) {
        if (m[i][k] == oo) {
          continue;
        }
        for (j = (1); j <= (B.c); j++) {
          if (B.m[k][j] == oo) {
            continue;
          }
          t[i][j] = myMin(t[i][j], m[i][k] + B.m[k][j]);
        }
      }
    }
    c = B.c;
    for (i = (1); i <= (r); i++) {
      for (j = (1); j <= (c); j++) {
        m[i][j] = t[i][j];
      }
    }
  }
};
int X, K, n, q, scnt, P;
mat ans;
map<int, int> exc;
int c[maxk], no[maxc], invNo[maxs];
pair<int, int> ss[maxq];
mat R2[maxp];
void pre() {
  int i, j;
  ans.r = 1;
  ans.c = scnt;
  for (i = (1); i <= (scnt); i++) {
    ans.m[1][i] = oo;
  }
  ans.m[1][1] = 0;
  R2[0].r = R2[0].c = scnt;
  for (i = (1); i <= (scnt); i++) {
    for (j = (1); j <= (scnt); j++) {
      R2[0].m[i][j] = oo;
    }
  }
  for (i = (1); i <= (scnt); i++) {
    if (!(invNo[i] & 1)) {
      R2[0].m[i][no[invNo[i] >> 1]] = 0;
    }
  }
  for (i = (1); i <= (scnt); i++) {
    if (invNo[i] & 1) {
      for (j = (1); j <= (K); j++) {
        if (!((invNo[i] >> j) & 1)) {
          R2[0].m[i][no[(invNo[i] | (1 << j)) >> 1]] = c[j];
        }
      }
    }
  }
  for (i = 1; (1 << i) < n; i++) {
    R2[i] = R2[i - 1];
    R2[i].mul(R2[i - 1]);
  }
  P = i - 1;
}
int main() {
  int i, j, l, o, dlt, st, sup, tcnt;
  mat T;
  scanf("%d%d%d%d", &X, &K, &n, &q);
  st = (1 << X) - 1;
  sup = st << (K - X);
  for (i = (st); i <= (sup); i++) {
    tcnt = 0;
    for (j = (0); j <= (K - 1); j++) {
      tcnt += (i >> j) & 1;
    }
    if (tcnt == X) {
      no[i] = ++scnt;
      invNo[scnt] = i;
    }
  }
  for (i = (1); i <= (K); i++) {
    scanf("%d", &c[i]);
  }
  pre();
  for (i = (1); i <= (q); i++) {
    scanf("%d%d", &ss[i].first, &ss[i].second);
    exc[ss[i].first] = ss[i].second;
  }
  sort(ss + 1, ss + q + 1);
  for (i = j = 1; i <= q; i++) {
    for (dlt = ss[i].first - K - j, l = 0; dlt > 0 && l <= P; dlt >>= 1, l++) {
      if (dlt & 1) {
        ans.mul(R2[l]);
      }
    }
    j = myMax(j, ss[i].first - K);
    for (; j < ss[i].first && j + X <= n; j++) {
      T = R2[0];
      for (l = (1); l <= (scnt); l++) {
        if (invNo[l] & 1) {
          for (o = (1); o <= (K); o++) {
            if (!((invNo[l] >> o) & 1)) {
              T.m[l][no[(invNo[l] | (1 << o)) >> 1]] += exc[j + o];
            }
          }
        }
      }
      ans.mul(T);
    }
  }
  for (dlt = n - X + 1 - j, l = 0; dlt > 0 && l <= P; dlt >>= 1, l++) {
    if (dlt & 1) {
      ans.mul(R2[l]);
    }
  }
  printf("%I64d", ans.m[1][1]);
  return 0;
}