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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
vector<int> status;
int bel[10984];
const long long inf = 1e18;
struct mat {
  long long a[75][75];
};
void out(mat g) {
  for (int i = 0; i < status.size(); i++) {
    for (int j = 0; j < status.size(); j++) cout << g.a[i][j] << " ";
    cout << "\n";
  }
  cout << "\n\n";
}
mat multiple(mat a, mat b) {
  mat g;
  for (int i = 0; i < status.size(); i++) {
    for (int j = 0; j < status.size(); j++) {
      g.a[i][j] = inf;
      for (int k = 0; k < status.size(); k++) {
        g.a[i][j] = min(g.a[i][j], a.a[i][k] + b.a[k][j]);
      }
    }
  }
  return g;
}
mat qpow(mat x, int y) {
  mat g;
  for (int i = 0; i < status.size(); i++)
    for (int j = 0; j < status.size(); j++) g.a[i][j] = inf;
  for (int i = 0; i < status.size(); i++) g.a[i][i] = 0;
  while (y) {
    if (y & 1) g = multiple(g, x);
    x = multiple(x, x);
    y /= 2;
  }
  return g;
}
pair<int, int> scp[108];
pair<int, int> tp[108];
int scpl;
int _count(int mask) {
  int res = 0;
  for (int i = 30; i >= 0; i--)
    if ((1 << i) & mask) res++;
  return res;
}
long long cost[75];
long long dp[267][75];
long long alr;
map<int, int> clef;
int main() {
  int x, k, n, q;
  cin >> x >> k >> n >> q;
  for (int i = 1; i <= k; i++) cin >> cost[i];
  for (int i = 1; i <= q; i++) cin >> tp[i].first >> tp[i].second;
  for (int i = 0; i < 1025; i++) bel[i] = 73;
  sort(tp + 1, tp + q + 1);
  for (int i = q; i >= 1; i--) {
    if (tp[i].first >= n - x + 1) {
      alr += tp[i].second;
    } else {
      q = i;
      break;
    }
  }
  for (int i = 1; i <= q; i++) clef[tp[i].first] = (tp[i].second);
  for (int i = 1; i <= q; i++) {
    tp[i].first -= k;
    if (tp[i].first < 2) tp[i].first = 2;
  }
  for (int i = 0; i < (1 << k); i++) {
    if (_count(i) == x) status.push_back(i), bel[i] = status.size() - 1;
  }
  mat op, ans;
  for (int i = 0; i < 75; i++)
    for (int j = 0; j < 75; j++) op.a[i][j] = inf, ans.a[i][j] = inf;
  ans.a[0][0] = 0;
  for (int id = 0; id < status.size(); id++) {
    int fl = 0;
    int i = status[id];
    int st = (i >> 1);
    if ((i & 1) == 0) {
      op.a[id][bel[st]] = 0;
    } else {
      for (int j = 0; j < k; j++) {
        if (st & (1 << j)) continue;
        op.a[id][bel[st | (1 << (j))]] = cost[j + 1];
      }
    }
  }
  scp[0].second = 1;
  scpl = 0;
  for (int i = 1; i <= q; i++) {
    if (scpl > 0 and tp[i].first <= scp[scpl].second + 1)
      scp[scpl].second = tp[i].first + k;
    else
      scp[++scpl].first = tp[i].first, scp[scpl].second = tp[i].first + k;
  }
  for (int id = 1; id <= scpl; id++) {
    ans = multiple(ans, qpow(op, scp[id].first - scp[id - 1].second - 1));
    for (int i = 0; i <= scp[id].second - scp[id].first + 10; i++)
      for (int j = 0; j < 75; j++) dp[i][j] = inf;
    for (int i = 0; i < status.size(); i++) dp[0][i] = ans.a[0][i];
    for (int i = scp[id].first; i <= scp[id].second; i++) {
      long long tmp = 0;
      int sid = i - scp[id].first;
      for (int j = 0; j < status.size(); j++) {
        int st = status[j];
        st = (st >> 1);
        if ((status[j] & 1) == 0) {
          dp[sid + 1][bel[st]] = min(dp[sid + 1][bel[st]], dp[sid][j]);
        } else {
          for (int l = 0; l < k; l++) {
            if (st & (1 << l)) continue;
            int nst = (st | (1 << l));
            if (clef.count(i + l)) tmp = clef[i + l];
            dp[sid + 1][bel[nst]] =
                min(dp[sid + 1][bel[nst]], dp[sid][j] + tmp + cost[l + 1]);
            tmp = 0;
          }
        }
      }
    }
    for (int i = 0; i < status.size(); i++)
      ans.a[0][i] = dp[scp[id].second - scp[id].first + 1][i];
  }
  ans = multiple(ans, qpow(op, n - x - scp[scpl].second + 1));
  cout << alr + ans.a[0][0];
}