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>
long long c[1111];
int V;
int ref[1111], stk[1111];
struct matrix {
  long long Mt[72][72];
  void reset() { memset(Mt, 0x3f, sizeof Mt); }
};
matrix operator*(matrix x, matrix y) {
  matrix ret;
  register int i, ii, iii;
  for (i = 1; i <= V; i++)
    for (ii = 1; ii <= V; ii++) ret.Mt[i][ii] = 1e18;
  for (i = 1; i <= V; i++)
    for (iii = 1; iii <= V; iii++)
      for (ii = 1; ii <= V; ii++) {
        long long T = x.Mt[i][iii] + y.Mt[iii][ii];
        if (ret.Mt[i][ii] > T) ret.Mt[i][ii] = T;
      }
  return ret;
}
int popcnt[11111];
int trans(int x, int d) {
  if (x & (1 << d)) return -1;
  return (x | (1 << d)) >> 1;
}
int x, k, n, q;
matrix gen(long long* cs) {
  register int i, ii;
  matrix ret;
  ret.reset();
  for (i = 1; i <= V; i++) {
    int G = stk[i];
    if ((G & 1) == 0) {
      ret.Mt[i][ref[G >> 1]] = 0;
      continue;
    }
    for (ii = 1; ii <= k; ii++) {
      int t = trans(G, ii);
      if (~t) ret.Mt[i][ref[t]] = cs[ii];
    }
  }
  return ret;
}
std::map<int, int> Ext;
std::map<int, matrix> Exp;
long long tmp[1111];
void ins(int p, int w) {
  Ext[p] = w;
  register int i, ii;
  for (i = p - 1; i && i >= p - k; i--) {
    if (i > n - x) continue;
    for (ii = 1; ii <= k; ii++) tmp[ii] = Ext[ii + i] + c[ii];
    Exp[i] = gen(tmp);
  }
}
matrix qpow(matrix g, int p) {
  matrix r = g;
  for (p--; p; p >>= 1, g = g * g)
    if (p & 1) r = r * g;
  return r;
}
void solve() {
  matrix A, R = gen(c);
  A.reset(), A.Mt[1][1] = 0;
  int P = 1;
  for (auto i : Exp) {
    if (P ^ i.first) A = A * qpow(R, i.first - P);
    A = A * i.second, P = i.first + 1;
  }
  if (P ^ (n - x + 1)) A = A * qpow(R, n - x + 1 - P);
  printf("%lld\n", A.Mt[1][1]);
}
int main() {
  scanf("%d%d%d%d", &x, &k, &n, &q);
  register int i;
  for (i = 1; i <= k; i++) scanf("%lld", c + i);
  for (i = 1; i < (1 << k); i++) popcnt[i] = popcnt[i >> 1] + (i & 1);
  for (i = 1; i < (1 << k); i++)
    if (popcnt[i] == x) stk[++V] = i, ref[i] = V;
  int p, w;
  for (i = 1; i <= q; i++) scanf("%d%d", &p, &w), ins(p, w);
  solve();
}