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;
inline void chmin(long long &x, long long v) {
  if (x > v) x = v;
}
int X, K, N, Q;
int D[8];
long long F[27][1 << 8][1 << 8];
int LP[1 << 8];
void merge(long long a[1 << 8][1 << 8], long long b[1 << 8][1 << 8],
           long long o[1 << 8][1 << 8]) {
  for (int i = 0; i < (1 << K); i++)
    for (int j = 0; j < (1 << K); j++) o[i][j] = (1LL << 60);
  for (int x = 0; x < (1 << K); x++)
    for (int y = 0; y < (1 << K); y++)
      for (int z = 0; z < (1 << K); z++) chmin(o[x][z], a[x][y] + b[y][z]);
}
long long dp[2][1 << 8];
void blank(int len) {
  for (int k = 26; k >= 0; k--)
    if ((len >> k) & 1) {
      for (int i = 0; i < (1 << K); i++) dp[1][i] = (1LL << 60);
      for (int src = 0; src < (1 << K); src++)
        for (int dst = 0; dst < (1 << K); dst++)
          chmin(dp[1][dst], dp[0][src] + F[k][src][dst]);
      swap(dp[0], dp[1]);
    }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> X >> K >> N >> Q;
  for (int i = 0; i < (K); i++) cin >> D[i];
  for (int i = 0; i < (1 << K); i++) {
    int lp = 0;
    for (int pos = 0; pos < (K); pos++)
      if ((i >> pos) & 1) lp = pos;
    LP[i] = lp;
  }
  for (int i = 0; i < (1 << K); i++)
    for (int j = 0; j < (1 << K); j++) F[0][i][j] = (1LL << 60);
  for (int src = 0; src < (1 << K); src++)
    if (src) {
      int lp = LP[src];
      if (lp < K - 1) chmin(F[0][src][src << 1], 0);
      chmin(F[0][src][((src ^ (1 << lp)) << 1) | 1], D[lp]);
      for (int to = lp - 1; to >= 0; to--)
        if (((src >> to) & 1) == 0) {
          chmin(F[0][src][((src ^ (1 << lp) ^ (1 << to)) << 1)],
                D[lp - to - 1]);
        }
      for (int x = (1 << K) - 1; x > 0; x--) {
        int lp = LP[x];
        for (int to = lp - 1; to >= 0; to--)
          if (((x >> to) & 1) == 0) {
            chmin(F[0][src][x ^ (1 << lp) ^ (1 << to)],
                  F[0][src][x] + D[lp - to - 1]);
          }
      }
    }
  for (int i = 0; i < (26); i++) merge(F[i], F[i], F[i + 1]);
  vector<int> xs;
  map<int, int> mp;
  for (int i = 0; i < (Q); i++) {
    int p, w;
    cin >> p >> w;
    mp[p] = w;
    for (int x = max(p - K, X + 1); x <= min(p + K, N); x++) xs.push_back(x);
  }
  sort((xs).begin(), (xs).end());
  xs.erase(unique((xs).begin(), (xs).end()), (xs).end());
  for (int i = 0; i < (1 << K); i++) dp[0][i] = (1LL << 60);
  chmin(dp[0][(1 << X) - 1], 0);
  int pos = X;
  for (int p : xs) {
    blank(p - pos - 1);
    int w = mp[p];
    for (int i = 0; i < (1 << K); i++) dp[1][i] = (1LL << 60);
    for (int src = 0; src < (1 << K); src++)
      if (src) {
        int lp = LP[src];
        if (lp < K - 1) chmin(dp[1][src << 1], dp[0][src]);
        chmin(dp[1][((src ^ (1 << lp)) << 1) | 1], dp[0][src] + D[lp] + w);
        for (int to = lp - 1; to >= 0; to--)
          if (((src >> to) & 1) == 0) {
            chmin(dp[1][(src ^ (1 << lp) ^ (1 << to)) << 1],
                  dp[0][src] + D[lp - to - 1] + mp[p - 1 - to]);
          }
      }
    for (int src = (1 << K) - 1; src > 0; src--) {
      int lp = LP[src];
      for (int to = lp - 1; to >= 0; to--)
        if (((src >> to) & 1) == 0) {
          chmin(dp[1][src ^ (1 << lp) ^ (1 << to)],
                dp[1][src] + D[lp - to - 1] + mp[p - to]);
        }
    }
    swap(dp[0], dp[1]);
    pos = p;
  }
  blank(N - pos);
  cout << dp[0][(1 << X) - 1] << "\n";
  return 0;
}