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, c[8 + 1], maskMap[(1 << 8)], invMaskMap[70];
long long A[27][70][70], B[70][70], T[70][70], C[70], D[70];
const long long inf = 1E18;
map<int, int> w;
void Reset(long long A[70]) {
  for (int i = 0; i < 70; ++i) A[i] = inf;
}
void Reset(long long A[70][70]) {
  for (int i = 0; i < 70; ++i)
    for (int j = 0; j < 70; ++j) A[i][j] = inf;
}
void CopyMat(long long S[70][70], long long D[70][70]) {
  for (int i = 0; i < 70; ++i)
    for (int j = 0; j < 70; ++j) D[i][j] = S[i][j];
}
void MatMul(long long A[70][70], long long B[70][70], long long C[70][70]) {
  Reset(T);
  for (int i = 0; i < 70; ++i)
    for (int j = 0; j < 70; ++j)
      for (int k = 0; k < 70; ++k) T[i][j] = min(T[i][j], A[i][k] + B[k][j]);
  CopyMat(T, C);
}
void PreProcess(int n, int k, int b) {
  for (int mask = 0, mask_map = 0; mask < (1 << k); ++mask) {
    if (__builtin_popcount(mask) == b) {
      maskMap[mask] = mask_map++;
      invMaskMap[maskMap[mask]] = mask;
      m = mask_map;
    }
  }
  Reset(A[0]);
  for (int x = 0; x < m; ++x) {
    int i = invMaskMap[x], ci = x;
    if ((i & 1) == 0) {
      int cj = maskMap[(i >> 1)];
      A[0][ci][cj] = 0;
    } else {
      for (int l = 1; l <= k; ++l) {
        if ((i & (1 << l)) > 0) continue;
        int j = ((i | (1 << l)) >> 1), cj = maskMap[j];
        A[0][ci][cj] = c[l];
      }
    }
  }
  for (int l = 1; (1 << l) <= n; ++l) MatMul(A[l - 1], A[l - 1], A[l]);
  Reset(C);
  C[maskMap[(1 << b) - 1]] = 0;
}
void MultiplyPowerA(int n) {
  for (int k = 27 - 1; k > -1 && n > 0; --k) {
    if ((1 << k) <= n) {
      MatMul(B, A[k], B);
      n -= (1 << k);
    }
  }
}
void FillC() {
  Reset(C);
  for (int i = 0; i < 70; ++i)
    for (int j = 0; j < 70; ++j) C[i] = min(C[i], B[j][i]);
}
void FillB() {
  for (int i = 0; i < 70; ++i)
    for (int j = 0; j < 70; ++j) B[i][j] = C[j];
}
void MoveOneStep(int k, int p) {
  Reset(D);
  for (int x = 0; x < m; ++x) {
    int i = invMaskMap[x], ci = x;
    if ((i & 1) == 0) {
      int j = (i >> 1), cj = maskMap[j];
      D[cj] = min(D[cj], C[ci]);
    } else {
      for (int l = 1; l <= k; ++l) {
        if ((i & (1 << l)) > 0) continue;
        int j = ((i | (1 << l)) >> 1), cj = maskMap[j];
        D[cj] = min(D[cj], C[ci] + c[l] + w[p + l]);
      }
    }
  }
  for (int i = 0; i < 70; ++i) C[i] = D[i];
}
int main() {
  int b, k, n, q;
  vector<int> v;
  cin >> b >> k >> n >> q;
  for (int i = 1; i <= k; ++i) cin >> c[i];
  while (q--) {
    int p, wp;
    cin >> p >> wp;
    w[p] = wp;
    v.push_back(p);
  }
  n -= (b - 1);
  PreProcess(n, k, b);
  v.push_back(n);
  sort(v.begin(), v.end());
  int i = 1;
  for (auto j : v) {
    int l = max(0, min(j - k, n) - i);
    if (l) {
      FillB();
      MultiplyPowerA(l);
      FillC();
      i += l;
    }
    for (; i < n && i < j; ++i) MoveOneStep(k, i);
    if (i == n) break;
  }
  cout << C[maskMap[(1 << b) - 1]] << '\n';
  return 0;
}