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 LINF = (long long)1e18 + 7;
int w1, w2, n, q;
long long cost[11];
struct st {
  long long a[77][77];
  st() {
    for (int i = 0; i < 77; i++)
      for (int j = 0; j < 77; j++) a[i][j] = 0;
  }
};
st t;
long long dp[77];
vector<int> w;
st func(st &a, st b) {
  st ans;
  for (int i = 0; i < w.size(); i++) {
    for (int j = 0; j < w.size(); j++) {
      ans.a[i][j] = LINF;
      for (int s = 0; s < w.size(); s++)
        ans.a[i][j] = min(ans.a[i][j], a.a[i][s] + b.a[s][j]);
    }
  }
  return ans;
}
st bp(st a, int k) {
  if (k == 1) return a;
  if (k % 2 == 1) {
    return func(a, bp(a, k - 1));
  } else {
    auto tmp = bp(a, k >> 1);
    return func(tmp, tmp);
  }
}
long long tmp[77];
int first[77];
long long cc[77];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> w1 >> w2 >> n >> q;
  for (int i = 0; i < w2; i++) cin >> cost[i];
  for (int mask = 0; mask < (1 << w2); mask++)
    if (__builtin_popcount(mask) == w1) w.push_back(mask);
  for (int i = 0; i < 77; i++)
    for (int j = 0; j < 77; j++) t.a[i][j] = LINF;
  map<int, int> to;
  for (int i = 0; i < w.size(); i++) to[w[i]] = i;
  for (int i = 0; i < w.size(); i++) {
    int mask = w[i];
    if (mask % 2 == 0) {
      t.a[i][to[mask >> 1]] = 0;
    } else {
      for (int len = 0; len < w2; len++) {
        int now = mask >> 1;
        if (!((now >> len) & 1)) t.a[i][to[now ^ (1 << len)]] = cost[len];
      }
    }
  }
  for (int i = 0; i < 77; i++) dp[i] = LINF;
  int startMask = 0;
  for (int i = 0; i < w1; i++) startMask ^= (1 << i);
  dp[to[startMask]] = 0;
  int pos = 1;
  map<int, long long> getFunc;
  vector<pair<int, int> > suki(q);
  for (int i = 0; i < q; i++) cin >> suki[i].first >> suki[i].second;
  sort(suki.begin(), suki.end());
  for (int i = 0; i < q; i++)
    first[i] = suki[i].first, cc[i] = suki[i].second, getFunc[first[i]] = cc[i];
  int uk = 0;
  while (1) {
    while (uk < q && first[uk] < pos) uk++;
    int can;
    if (uk == q) {
      can = (n - w1 + 1) - pos;
    } else {
      can = (first[uk] - 1) - (pos + w2 - 1);
    }
    can = max(can, 0);
    if (can != 0) {
      auto now = bp(t, can);
      for (int i = 0; i < w.size(); i++) {
        tmp[i] = LINF;
        for (int j = 0; j < w.size(); j++) {
          tmp[i] = min(tmp[i], dp[j] + now.a[j][i]);
        }
      }
      for (int i = 0; i < w.size(); i++) dp[i] = tmp[i];
      pos += can;
    }
    if (pos + w1 - 1 == n) break;
    while (1) {
      for (int i = 0; i < 77; i++) tmp[i] = LINF;
      for (int i = 0; i < w.size(); i++) {
        if (w[i] % 2 == 0) {
          tmp[to[w[i] >> 1]] = min(tmp[to[w[i] >> 1]], dp[i]);
        } else {
          for (int len = 0; len < w2; len++) {
            int gg = w[i] >> 1;
            if (!((gg >> len) & 1)) {
              gg ^= (1 << len);
              tmp[to[gg]] =
                  min(tmp[to[gg]], dp[i] + cost[len] + getFunc[pos + len + 1]);
            }
          }
        }
      }
      for (int i = 0; i < 77; i++) dp[i] = tmp[i];
      pos++;
      if (pos + w1 - 1 == n) break;
      bool need = 0;
      for (int i = 0; i < q; i++) {
        int l = pos, r = pos + w2 - 1;
        if (first[i] >= l && first[i] <= r) {
          need = 1;
          break;
        }
      }
      if (!need) break;
    }
    if (pos + w1 - 1 == n) break;
  }
  cout << dp[to[startMask]];
}