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>
template <class _Tp>
inline void min(_Tp &A, const _Tp &B) {
  if (B < A) A = B;
}
inline int count1(const long long &x) {
  return x ? (x & 1LL) + count1(x >> 1) : 0;
}
class matrix {
 private:
  static const int SZ = 256;
  long long V[SZ][SZ];

 public:
  matrix() { init(); }
  void init() { memset(V, 0x3f, sizeof(V)); }
  long long *operator[](const int &x) { return V[x]; }
  const long long *operator[](const int &x) const { return V[x]; }
} P[30];
int x, K, n, q, sz;
matrix mul(const matrix &A, const matrix &B, const int &sz) {
  matrix ret;
  for (int k = 0; k < sz; ++k)
    for (int i = 0; i < sz; ++i)
      if (A[i][k] != 0x3f3f3f3f3f3f3f3fLL)
        for (int j = 0; j < sz; ++j)
          if (B[k][j] != 0x3f3f3f3f3f3f3f3fLL)
            min(ret[i][j], A[i][k] + B[k][j]);
  return ret;
}
struct pll {
  long long x, y;
  pll(const long long &a = 0, const long long &b = 0) : x(a), y(b) {}
  bool operator<(const pll &A) const { return x < A.x; }
} B[30];
void Build_Matrix() {
  long long Cost[10];
  for (int i = (1); i < (K + 1); ++i) scanf("%lld", Cost + i);
  for (int i = 2; i < 1 << K; i += 2)
    if (count1(i) == x) P[0][i][i >> 1] = 0;
  for (int i = 1; i < 1 << K; i += 2)
    if (count1(i) == x)
      for (int j = 1; j <= K; ++j)
        if (!(i & 1 << j)) P[0][i][i >> 1 | 1 << j - 1] = Cost[j];
  for (int i = (1); i < (30); ++i) P[i] = mul(P[i - 1], P[i - 1], sz);
}
void init() {
  scanf("%d%d%d%d", &x, &K, &n, &q);
  sz = 1 << K;
  Build_Matrix();
  for (int i = (0); i < (q); ++i) scanf("%lld%lld", &B[i].x, &B[i].y);
  std::sort(B, B + q);
}
long long work() {
  matrix ans;
  ans[0][(1 << x) - 1] = 0;
  for (int i = 0, j = 1; i < q; ++i) {
    for (int l = 29; j < B[i].x - K; --l)
      if (j + (1 << l) <= B[i].x - K) ans = mul(ans, P[l], sz), j += 1 << l;
    for (; j < B[i].x && j < n - x + 1; ++j) {
      matrix tmp = P[0];
      for (int l = i; l < q; ++l)
        if (B[l].x > j + K)
          break;
        else
          for (int o = 1; o < sz; o += 2)
            if (count1(o) == x && !(o & 1 << B[l].x - j))
              tmp[o][o >> 1 | 1 << B[l].x - j - 1] += B[l].y;
      ans = mul(ans, tmp, sz);
    }
  }
  for (int l = 29, j = q ? B[q - 1].x : 1; j < n - x + 1; --l)
    if (j + (1 << l) <= n - x + 1) ans = mul(ans, P[l], sz), j += 1 << l;
  return ans[0][(1 << x) - 1];
}
int main() {
  init();
  printf("%lld\n", work());
  return 0;
}