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;
template <class T>
bool uin(T &a, T b) {
  return (a > b ? a = b, true : false);
}
template <class T>
bool uax(T &a, T b) {
  return (a < b ? a = b, true : false);
}
int const X = 8;
int const L = 17;
int const N = 41;
long long const INF = 3e18 + 41;
int x, k, n, q;
int c[N];
int p[N], w[N];
long long d[(1 << X)][(1 << X)][L];
long long ans;
bool bit(int m, int i) { return (m & (1 << i)); }
int xorbit(int m, int i) { return (m ^ (1 << i)); }
int dx[(1 << X)][(1 << X)];
unordered_map<int, int> a;
vector<pair<int, long long>> e[(1 << X)][L];
void build() {
  for (int i = 0; i < (1 << X); ++i)
    for (int j = 0; j < (1 << X); ++j)
      for (int o = 0; o < L; ++o) d[i][j][o] = INF;
  memset(dx, 255, sizeof(dx));
  for (int i = 0; i < (1 << k); ++i) {
    if (!bit(i, 0)) {
      int m0 = i;
      int m1 = (m0 >> 1);
      uin(d[m0][m1][0], 0ll);
    } else {
      int m0 = i;
      for (int j = 1; j < k + 1; ++j) {
        if (bit(m0, j)) continue;
        int m1 = xorbit(m0, j);
        m1 = xorbit(m1, 0);
        m1 >>= 1;
        if (uin(d[m0][m1][0], (long long)c[j - 1])) dx[m0][m1] = j;
      }
    }
  }
  for (int o = 1; o < L; ++o) {
    for (int t = 0; t < (1 << k); ++t) {
      for (int i = 0; i < (1 << k); ++i) {
        for (int j = 0; j < (1 << k); ++j) {
          uin(d[i][j][o], d[i][t][o - 1] + d[t][j][o - 1]);
        }
      }
    }
  }
  for (int o = 0; o < L; ++o) {
    for (int i = 0; i < (1 << X); ++i)
      for (int j = 0; j < (1 << X); ++j)
        if (d[i][j][o] < INF) {
          e[i][o].push_back(make_pair(j, d[i][j][o]));
        }
  }
}
long long f[(1 << X)], nf[(1 << X)];
void solve() {
  int p1 = 0;
  int x0 = 0;
  for (int i = 0; i < (1 << X); ++i) f[i] = INF;
  f[(1 << x) - 1] = 0;
  while (x0 < n - x) {
    while (p1 < q && x0 > p[p1]) ++p1;
    int s;
    for (int i = L - 1; i >= 0; --i) {
      s = i;
      if (x0 + (1 << i) + k - 1 > n - 1) continue;
      if (p1 != q && x0 + (1 << i) + k - 1 >= p[p1]) continue;
      break;
    }
    for (int i = 0; i < (1 << k); ++i) nf[i] = INF;
    for (int i = 0; i < (1 << k); ++i) {
      if (f[i] == INF) continue;
      for (pair<int, long long> p : e[i][s]) {
        long long v = f[i] + p.second;
        if (s == 0 && dx[i][p.first] != -1 &&
            a.find(x0 + dx[i][p.first]) != a.end()) {
          v += a[x0 + dx[i][p.first]];
        }
        uin(nf[p.first], v);
      }
    }
    memcpy(f, nf, sizeof(f));
    x0 += (1 << s);
  }
  ans = f[(1 << x) - 1];
}
int main() {
  scanf("%d %d %d %d", &x, &k, &n, &q);
  for (int i = 0; i < k; ++i) scanf("%d", &c[i]);
  for (int i = 0; i < q; ++i) {
    scanf("%d %d", &p[i], &w[i]);
    --p[i];
    a[p[i]] = w[i];
  }
  for (int i = 0; i < q; ++i)
    for (int j = i + 1; j < q; ++j)
      if (p[j] < p[i]) {
        swap(p[j], p[i]);
        swap(w[j], w[i]);
      }
  build();
  solve();
  printf("%I64d\n", ans);
  return 0;
}