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;
const long long INF = 1LL << 60;
int x, k, n, q, m;
int c[10];
vector<int> status;
int rs[256];
vector<vector<long long> > F[32];
map<int, int> W;
int jump_to(int s, int t, vector<long long> &cur) {
  if (s >= t) return s;
  int d = t - s;
  for (int h = 0; h < (int)(31); h++) {
    if (d & 1 << h) {
      vector<long long> nxt(m, INF);
      for (int i = 0; i < (int)(m); i++)
        for (int j = 0; j < (int)(m); j++)
          nxt[i] = min(nxt[i], cur[j] + F[h][j][i]);
      for (int i = 0; i < (int)(m); i++) cur[i] = nxt[i];
    }
  }
  return t;
}
int walk_to(int s, int t, int wp, vector<long long> &cur) {
  if (s >= t) return s;
  while (s < t) {
    vector<long long> nxt(m, INF);
    for (int i = 0; i < (int)(m); i++) {
      int mask = status[i];
      if (!(mask & 1)) {
        nxt[rs[mask >> 1]] = min(nxt[rs[mask >> 1]], cur[i]);
      } else {
        for (int j = (int)(1); j < (int)(k + 1); j++) {
          if (!(mask & 1 << j)) {
            int nask = mask | 1 << j;
            nxt[rs[nask >> 1]] =
                min(nxt[rs[nask >> 1]], cur[i] + c[j] + W[s + j]);
          }
        }
      }
    }
    for (int i = 0; i < (int)(m); i++) cur[i] = nxt[i];
    ++s;
  }
  return t;
}
void disp(int p, const vector<long long> &v) {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> x >> k >> n >> q;
  for (int i = 0; i < (int)(k); i++) cin >> c[i + 1];
  for (int mask = 0; mask < (int)(1 << k); mask++) {
    if (__builtin_popcountll(mask) == x) status.push_back(mask);
  }
  m = status.size();
  for (int i = 0; i < (int)(m); i++) rs[status[i]] = i;
  F[0] = vector<vector<long long> >(m, vector<long long>(m, INF));
  for (int i = 0; i < (int)(m); i++) {
    int mask = status[i];
    if (!(mask & 1)) {
      F[0][i][rs[mask >> 1]] = 0;
    } else {
      for (int j = (int)(1); j < (int)(k + 1); j++) {
        if (!(mask & 1 << j)) {
          int nask = mask | 1 << j;
          F[0][i][rs[nask >> 1]] = c[j];
        }
      }
    }
  }
  for (int t = 0; t < (int)(31); t++) {
    F[t + 1] = vector<vector<long long> >(m, vector<long long>(m, INF));
    for (int i = 0; i < (int)(m); i++)
      for (int j = 0; j < (int)(m); j++) {
        for (int h = 0; h < (int)(m); h++)
          F[t + 1][i][j] = min(F[t + 1][i][j], F[t][i][h] + F[t][h][j]);
      }
  }
  vector<pair<int, int> > ps(q);
  for (int i = 0; i < (int)(q); i++) {
    int p, wp;
    cin >> p >> wp;
    ps[i] = make_pair(p, wp);
    W[p] = wp;
  }
  vector<long long> cur(m, INF);
  cur[0] = 0;
  int pos = 1;
  sort((ps).begin(), (ps).end());
  int ed = n - x + 1;
  for (int i = 0; i < (int)(ps.size()); i++) {
    int p = ps[i].first;
    int wp = ps[i].second;
    pos = jump_to(pos, min(ed, p - k), cur);
    disp(pos, cur);
    pos = walk_to(pos, min(ed, p), wp, cur);
    disp(pos, cur);
  }
  pos = jump_to(pos, ed, cur);
  disp(pos, cur);
  cout << cur[0] << endl;
  return 0;
}