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 int Imx = 2147483647;
const long long Lbig = 2e18;
const int mod = 1e9 + 7;
struct fastio {
  char s[100000];
  int it, len;
  fastio() { it = len = 0; }
  inline char get() {
    if (it < len) return s[it++];
    it = 0;
    len = fread(s, 1, 100000, stdin);
    if (len == 0)
      return EOF;
    else
      return s[it++];
  }
  bool notend() {
    char c = get();
    while (c == ' ' || c == '\n') c = get();
    if (it > 0) it--;
    return c != EOF;
  }
} _buff;
inline long long getnum() {
  long long r = 0;
  bool ng = 0;
  char c;
  c = _buff.get();
  while (c != '-' && (c < '0' || c > '9')) c = _buff.get();
  if (c == '-') ng = 1, c = _buff.get();
  while (c >= '0' && c <= '9') r = r * 10 + c - '0', c = _buff.get();
  return ng ? -r : r;
}
template <class T>
inline void putnum(T x) {
  if (x < 0) putchar('-'), x = -x;
  register short a[20] = {}, sz = 0;
  while (x) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
inline char getreal() {
  char c = _buff.get();
  while (c <= 32) c = _buff.get();
  return c;
}
long long qpow(long long x, long long k) {
  return k == 0 ? 1
                : 1ll * qpow(1ll * x * x % mod, k >> 1) * (k & 1 ? x : 1) % mod;
}
struct matrix {
  long long a[77][77];
  matrix() { memset(a, 31, sizeof(a)); }
  void set1() {
    memset(a, 31, sizeof(a));
    for (int i = 0; i < 77; i++) a[i][i] = 0;
  }
  matrix operator*(const matrix &t) const {
    matrix ret;
    for (int i = 0; i < 77; i++) {
      for (int j = 0; j < 77; j++) {
        for (int k = 0; k < 77; k++) {
          ret.a[i][k] = min(ret.a[i][k], a[i][j] + t.a[j][k]);
        }
      }
    }
    return ret;
  }
};
int n, m, K, q;
int cnt1[300];
int mskid[300];
int tot = 0;
int w[11];
matrix A;
matrix apw[30];
vector<pair<int, pair<int, int> > > v;
long long dp[77];
long long ndp[77];
void go(const matrix &t) {
  memset(ndp, 31, sizeof(ndp));
  for (int i = 0; i < 77; i++) {
    for (int j = 0; j < 77; j++) {
      ndp[j] = min(ndp[j], dp[i] + t.a[i][j]);
    }
  }
  swap(dp, ndp);
}
void go(int x) {
  for (int i = 0; i < 30; i++) {
    if ((x >> i) & 1) {
      go(apw[i]);
    }
  }
}
matrix construct(long long dlt[]) {
  matrix ret;
  for (int i = 1; i < (1 << m); i++) {
    if (cnt1[i] != n) continue;
    if (i & 1) {
      int nmsk = i >> 1;
      for (int j = 0; j < m; j++) {
        if ((nmsk >> j) & 1) continue;
        ret.a[mskid[i]][mskid[nmsk | (1 << j)]] = w[j] + dlt[j];
      }
    } else
      ret.a[mskid[i]][mskid[i >> 1]] = 0;
  }
  return ret;
}
int main() {
  for (int i = 1; i < 256; i++) cnt1[i] = cnt1[i - (i & (-i))] + 1;
  cin >> n >> m >> K >> q;
  for (int i = 0; i < m; i++) cin >> w[i];
  for (int i = 1; i < (1 << m); i++) {
    if (cnt1[i] == n) {
      mskid[i] = ++tot;
    }
  }
  long long tmp[10] = {};
  A = construct(tmp);
  apw[0] = A;
  for (int i = 1; i < 30; i++) apw[i] = apw[i - 1] * apw[i - 1];
  for (int i = 1; i <= q; i++) {
    int x, c;
    cin >> x >> c;
    for (int j = 0; j < m; j++) {
      int t = x - j + n - 1;
      if (t > n && t <= K) v.push_back(make_pair(t, make_pair(j, c)));
    }
  }
  sort(v.begin(), v.end());
  int pre = n;
  memset(dp, 31, sizeof(dp));
  dp[1] = 0;
  for (int i = 0; i < v.size();) {
    go(v[i].first - pre - 1);
    pre = v[i].first;
    int r = i;
    while (r < v.size() && v[r].first == v[i].first) r++;
    long long dlt[10] = {};
    for (int j = i; j < r; j++) {
      dlt[v[j].second.first] += v[j].second.second;
    }
    matrix B = construct(dlt);
    go(B);
    i = r;
  }
  go(K - pre);
  cout << dp[1] << endl;
  return 0;
}