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 maxn = 109, Log = 30;
struct node {
  int pos;
  long long val;
} b[maxn];
long long dis[Log + 1][maxn][maxn], g[maxn][maxn], tmp[maxn][maxn], f[maxn],
    h[maxn], a[maxn];
int sta[maxn], idx[1 << 10];
int n, tot, p, t, m, tar;
long long ans;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void update(long long &x, long long y) {
  if (x > y) x = y;
}
bool cmp(const node &x, const node &y) { return x.pos < y.pos; }
int count(int x) {
  int res = 0;
  while (x) {
    if (x & 1) res++;
    x >>= 1;
  }
  return res;
}
void trans(int step) {
  memset(g, 63, sizeof g);
  memset(h, 63, sizeof h);
  for (int i = 1; i <= tot; i++) g[i][i] = 0;
  for (int bit = 0; bit <= Log; bit++)
    if (step & (1 << bit)) {
      memset(tmp, 63, sizeof tmp);
      for (int i = 1; i <= tot; i++)
        for (int j = 1; j <= tot; j++)
          for (int k = 1; k <= tot; k++)
            update(tmp[i][j], g[i][k] + dis[bit][k][j]);
      memcpy(g, tmp, sizeof tmp);
    }
  for (int i = 1; i <= tot; i++)
    for (int j = 1; j <= tot; j++) update(h[i], f[j] + g[j][i]);
  memcpy(f, h, sizeof f);
}
int main() {
  t = read();
  p = read();
  n = read();
  m = read();
  for (int i = 1; i <= p; i++) a[i] = read();
  int mr = (1 << p) - 1;
  for (int i = 0; i <= mr; i++)
    if (count(i) == t) sta[++tot] = i, idx[i] = tot;
  tar = (1 << t) - 1;
  memset(dis, 63, sizeof dis);
  for (int i = 1; i <= tot; i++) {
    int now = sta[i];
    if (now & 1) {
      int nxt = now >> 1;
      for (int j = 0; j < p; j++)
        if (!(nxt & (1 << j))) {
          nxt += (1 << j);
          dis[0][i][idx[nxt]] = a[j + 1];
          nxt -= (1 << j);
        }
    } else
      dis[0][i][idx[now >> 1]] = 0;
  }
  for (int bit = 1; bit <= Log; bit++)
    for (int i = 1; i <= tot; i++)
      for (int j = 1; j <= tot; j++)
        for (int k = 1; k <= tot; k++)
          update(dis[bit][i][j], dis[bit - 1][i][k] + dis[bit - 1][k][j]);
  for (int i = 1; i <= m; i++) b[i].pos = read(), b[i].val = read();
  sort(b + 1, b + 1 + m, cmp);
  while (b[m].pos >= n - t + 1) ans += b[m].val, m--;
  b[++m] = (node){n - t + 1, 0};
  memset(f, 63, sizeof f);
  int now = 1;
  f[idx[tar]] = 0;
  for (int i = 1; i <= m; i++) {
    trans(b[i].pos - now);
    for (int j = 1; j <= tot; j++)
      if (sta[j] & 1) f[j] += b[i].val;
    now = b[i].pos;
  }
  cout << f[idx[tar]] + ans << endl;
  return 0;
}