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>
const int inf = (1ll << 30) - 1;
const int maxn = (int)1e5 + 10;
using namespace std;
int x, k, n, q;
set<int> S;
vector<int> V;
long long c[15];
long long dp[100100];
long long DD[100100];
long long DP[35][101][101];
map<int, long long> BAD;
vector<int> M;
void go(int len) {
  for (int j = 0; j < 30; j++) {
    if (len & (1 << j)) {
      for (int k = 0; k < M.size(); k++) {
        DD[k] = dp[k];
        dp[k] = (1ll << 60);
      }
      for (int k = 0; k < M.size(); k++) {
        for (int i = 0; i < M.size(); i++) {
          dp[i] = min(dp[i], DD[k] + DP[j][k][i]);
        }
      }
    }
  }
}
void calc(int z) {
  for (int i = 0; i < M.size(); i++) {
    DD[i] = dp[i];
    dp[i] = (1ll << 60);
  }
  for (int i = 0; i < M.size(); i++) {
    if (M[i] % 2 == 0) {
      int d = lower_bound(M.begin(), M.end(), M[i] / 2) - M.begin();
      dp[d] = min(dp[d], DD[i]);
      continue;
    }
    for (int j = 1; j <= k; j++) {
      if (M[i] & (1 << j)) continue;
      int x = M[i] | (1 << j);
      x >>= 1;
      int d = lower_bound(M.begin(), M.end(), x) - M.begin();
      if (BAD.count(z - k + j)) {
        dp[d] = min(dp[d], DD[i] + c[j] + BAD[z - k + j]);
      } else {
        dp[d] = min(dp[d], DD[i] + c[j]);
      }
    }
  }
}
void precalc() {
  for (int k = 1; k < 30; k++) {
    for (int i = 0; i < M.size(); i++) {
      for (int j = 0; j < M.size(); j++) {
        DP[k][i][j] = (1ll << 60);
      }
    }
    for (int i = 0; i < M.size(); i++) {
      for (int j = 0; j < M.size(); j++) {
        for (int t = 0; t < M.size(); t++) {
          DP[k][i][j] = min(DP[k - 1][i][t] + DP[k - 1][t][j], DP[k][i][j]);
        }
      }
    }
  }
}
void solve() {
  cin >> x >> k >> n >> q;
  for (int i = 1; i <= k; i++) {
    cin >> c[i];
  }
  for (int i = 1; i <= x; i++) {
    S.insert(i);
    S.insert(n - i + 1);
  }
  for (int i = 1; i <= k - x; i++) {
    S.insert(n + i);
  }
  for (int i = x + 1; i <= 2 * x + 2 * k; i++) {
    if (i <= n) S.insert(i);
    if (n - i + 1 > 0) S.insert(n - i + 1);
  }
  for (int i = 0, p, D; i < q; i++) {
    cin >> p >> D;
    BAD[p] = D;
    for (int j = 0; j <= 3 * k + 2; j++) {
      if (j < p) S.insert(p - j);
      if (j + p <= n) S.insert(p + j);
    }
  }
  for (__typeof(S.begin()) it = S.begin(); it != S.end(); it++) {
    V.push_back(*it);
  }
  for (int i = 0; i < (1 << k); i++) {
    if (__builtin_popcount(i) != x) continue;
    M.push_back(i);
  }
  for (int i = 0; i < M.size(); i++) {
    for (int j = 0; j < M.size(); j++) {
      DP[0][i][j] = (1ll << 60);
    }
  }
  for (int i = 0; i < M.size(); i++) {
    if (M[i] & 1) {
      for (int t = 1; t <= k; t++) {
        if (M[i] & (1 << t)) continue;
        int x = M[i] | (1 << t);
        x >>= 1;
        int d = lower_bound(M.begin(), M.end(), x) - M.begin();
        DP[0][i][d] = c[t];
      }
    } else {
      int d = lower_bound(M.begin(), M.end(), M[i] / 2) - M.begin();
      DP[0][i][d] = 0;
    }
  }
  precalc();
  int g =
      lower_bound(M.begin(), M.end(), ((1 << x) - 1) << (k - x)) - M.begin();
  for (int i = 0; i < M.size(); i++) {
    dp[i] = (1ll << 60);
  }
  dp[g] = 0;
  for (int i = x; i < V.size(); i++) {
    if (V[i] - V[i - 1] > 1) {
      go(V[i] - V[i - 1]);
    } else {
      calc(V[i]);
    }
  }
  cout << dp[0] << endl;
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}