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;
int m, k, n, q, cnt;
int state[75], inv[75 * 10], p[75];
int v[15];
map<int, int> h;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
void dfs(int x, int mask, int bitcnt) {
  if (x > n) {
    if (bitcnt != m) return;
    state[++cnt] = mask, inv[mask] = cnt;
    return;
  }
  if (bitcnt < m) dfs(x + 1, mask | (1 << (x - 1)), bitcnt + 1);
  dfs(x + 1, mask, bitcnt);
}
struct matrix {
  long long a[75][75];
  void clear() { memset(a, 63, sizeof(a)); }
  void init() {
    clear();
    for (int i = 1; i <= cnt; i++) a[i][i] = 0;
  }
  matrix operator*(const matrix &x) const {
    matrix ret;
    ret.clear();
    for (int i = 1; i <= cnt; i++)
      for (int j = 1; j <= cnt; j++)
        for (int k = 1; k <= cnt; k++)
          ret.a[i][j] = min(ret.a[i][j], a[i][k] + x.a[k][j]);
    return ret;
  }
  void build() {
    clear();
    for (int i = 1; i <= cnt; i++) {
      int mask = state[i];
      if (~mask & 1) a[i][inv[mask >> 1]] = 0;
      int x = __builtin_ctz(mask) + 1;
      mask ^= mask & -mask;
      mask >>= 1;
      for (int j = x + 1; j <= n + 1; j++)
        if (~mask >> (j - 2) & 1) a[i][inv[1 << (j - 2) | mask]] = v[j - x];
    }
  }
  void print() {
    for (int i = 1; i <= cnt; i++) {
      for (int j = 1; j <= cnt; j++) printf("%lld ", a[i][j]);
      puts("");
    }
  }
} ans, trans;
matrix power(matrix a, int k) {
  matrix ret;
  ret.init();
  for (; k; k >>= 1, a = a * a)
    if (k & 1) ret = ret * a;
  return ret;
}
matrix brute(matrix a, int pos) {
  matrix ret;
  ret.clear();
  for (int i = 1; i <= cnt; i++) {
    int mask = state[i];
    if (~mask & 1)
      ret.a[1][inv[mask >> 1]] = min(ret.a[1][inv[mask >> 1]], a.a[1][i]);
    int x = __builtin_ctz(mask) + 1;
    mask ^= mask & -mask, mask >>= 1;
    for (int j = x + 1; j <= n + 1; j++)
      if (~mask >> (j - 2) & 1) {
        long long res = a.a[1][i] + v[j - x] + h[pos + j - 1];
        int tmp = 1 << (j - 2) | mask;
        ret.a[1][inv[tmp]] = min(ret.a[1][inv[tmp]], res);
      }
  }
  return ret;
}
int main() {
  m = read(), n = read(), k = read() - m + 1, q = read();
  for (int i = 1; i <= n; i++) v[i] = read();
  dfs(1, 0, 0);
  trans.build();
  ans.clear(), ans.a[1][1] = 0;
  int pre = 1;
  for (int i = 1, x, y; i <= q; i++) x = read(), y = read(), h[x] = y, p[i] = x;
  sort(p + 1, p + q + 1);
  long long res = 0;
  while (q && p[q] >= k) res += h[p[q]], h[p[q]] = 0, --q;
  if (p[1] - n - 1 >= 0) ans = ans * power(trans, p[1] - n - 1), pre = p[1] - n;
  for (int l = 1, r = 1; l <= q; l = r + 1) {
    for (r = l; r <= q && p[r] - n - pre <= 0; ++r) pre = p[r];
    --r;
    for (int i = max(1, p[l] - n); i < p[r]; i++) ans = brute(ans, i);
    if (r + 1 <= q)
      ans = ans * power(trans, p[r + 1] - n - pre), pre = p[r + 1] - n;
  }
  ans = ans * power(trans, k - pre);
  printf("%lld\n", ans.a[1][1] + res);
  return 0;
}