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;
using LL = long long;
using pattern = char;
const LL INF = 0x3f3f3f3f3f3f3f3f;
LL X, K, N, Q, jmp[9];
vector<vector<LL>> oneStep;
vector<int> bitSet;
struct Mat {
  vector<vector<LL>> data;
  Mat(vector<vector<LL>> &d) { swap(d, data); }
  Mat() {}
  void operator*=(const Mat &o) {
    vector<vector<LL>> res(data.size(), vector<LL>(o.data[0].size(), INF));
    for (int &k : bitSet) {
      for (int &i : bitSet) {
        for (int &j : bitSet) {
          res[i][j] = min(res[i][j], data[i][k] + o.data[k][j]);
        }
      }
    }
    swap(data, res);
  }
  void operator+=(const Mat &o) {
    vector<vector<LL>> res(1, vector<LL>(o.data[0].size(), INF));
    for (int b : bitSet) {
      for (int e : bitSet) {
        res[0][e] = min(res[0][e], data[0][b] + o.data[b][e]);
      }
    }
    swap(res, data);
  }
};
ostream &operator<<(ostream &_cout, Mat &mat) {
  cout << "{\n";
  for (auto &m : mat.data) {
    for (LL &v : m) {
      cout << v << ' ';
    }
    cout << '\n';
  }
  cout << "}";
  return _cout;
}
struct Stone {
  LL loc, val;
  bool operator<(const Stone &o) const { return loc < o.loc; }
} magic[25];
map<int, LL> sstones;
vector<LL> &go(vector<LL> &beginState, const LL &stepCnt) {
  vector<vector<LL>> step(oneStep);
  Mat mat(step);
  Mat origin;
  origin.data.resize(1);
  swap(origin.data[0], beginState);
  for (int i = 0; (stepCnt >> i); i++) {
    if ((stepCnt >> i) & 1) {
      origin += mat;
    }
    mat *= mat;
  }
  swap(beginState, origin.data[0]);
  return beginState;
}
LL DP[209][1 << 8];
vector<LL> &dp(vector<LL> &lastState, const LL &curLoc, const LL &stepCnt) {
  memset(DP, 0x3f, sizeof DP);
  for (int &i : bitSet) {
    DP[0][i] = lastState[i];
  }
  int ci = 3;
  LL cv = 0;
  for (int step = 0; step < stepCnt; step++) {
    for (const int &cur : bitSet) {
      if (cur & 1) {
        for (int nb = 0; nb < K; nb++) {
          if (!((cur >> 1) & (1 << nb))) {
            int nxt = (cur >> 1) | (1 << nb);
            DP[step + 1][nxt] = min(DP[step + 1][nxt],
                                    DP[step][cur] + jmp[nb + 1] +
                                        (sstones.count(curLoc + step + nb + 1)
                                             ? sstones[curLoc + step + nb + 1]
                                             : 0));
          }
        }
      } else {
        int nxt = cur >> 1;
        DP[step + 1][nxt] = min(DP[step + 1][nxt], DP[step][cur]);
      }
    }
  }
  for (int &i : bitSet) {
    lastState[i] = DP[stepCnt][i];
  }
  return lastState;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> X >> K >> N >> Q;
  for (int i = 0; i < (1 << K); i++)
    if (__builtin_popcount(i) == X) bitSet.push_back(i);
  for (LL i = 1; i <= K; i++) {
    cin >> jmp[i];
  }
  for (LL i = 0; i < Q; i++) {
    cin >> magic[i].loc >> magic[i].val;
    sstones[magic[i].loc] = magic[i].val;
  }
  if (!sstones.count(N - X + 1)) sstones[N - X + 1] = 0;
  oneStep.resize(1 << K, vector<LL>(1 << K, INF));
  for (const int &cur : bitSet) {
    if ((cur & 1) == 1) {
      for (int nb = 0; nb < K; nb++) {
        if (!((cur >> 1) & (1 << nb))) {
          int nxt = (cur >> 1) | (1 << nb);
          oneStep[cur][nxt] = min(oneStep[cur][nxt], jmp[nb + 1]);
        }
      }
    } else if ((cur & 1) != 1) {
      oneStep[cur][cur >> 1] = 0;
    }
  }
  vector<LL> lastState(1 << K, INF);
  lastState[(1 << X) - 1] = 0;
  LL curLoc = 1;
  LL ans = INF;
  for (auto q = sstones.begin(); q != sstones.end();) {
    if (q->first - K - curLoc > 0) {
      go(lastState, q->first - K - curLoc);
      curLoc = q->first - K;
    }
    LL st_loc = q->first;
    while (q != sstones.end() && st_loc + K >= q->first) {
      st_loc = q->first;
      q++;
    }
    dp(lastState, curLoc, min(st_loc, N - X + 1) - curLoc);
    curLoc = st_loc;
  }
  ans = lastState[(1 << X) - 1];
  cout << ans << '\n';
  return 0;
}