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;
inline void Input_Output() {}
const double eps = 0.000001;
const long double pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const long long MOD = 1e18 + 9;
const long long INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;
const int K = 80;
const int pri = 997;
const int Magic = 2101;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int n, m, k, x;
vector<int> state;
int ids[(1 << 8)];
struct Mat {
  long long d[K][K];
  Mat(long long val = INF) {
    for (int i = 0; i < K; ++i)
      for (int j = 0; j < K; ++j) d[i][j] = INF;
  }
  Mat operator+(Mat &b) {
    Mat res;
    for (int i = 0; i < K; ++i)
      for (int j = 0; j < K; ++j)
        for (int k = 0; k < K; ++k)
          res.d[i][j] = min(res.d[i][j], d[i][k] + b.d[k][j]);
    return res;
  }
  void print() {
    for (int i = 0; i < K; ++i) {
      for (int j = 0; j < K; ++j) {
        if (d[i][j] == INF) {
          cout << "bd ";
          continue;
        }
        cout << d[i][j] << ' ';
      }
      cout << '\n';
    }
  }
};
Mat make_matrix(vector<long long> &c) {
  assert((int)(c.size()) == k);
  Mat res;
  for (int id = 0; id < (int)(state.size()); ++id) {
    int msk = state[id];
    if (msk % 2 == 0) {
      int nmsk = msk / 2;
      res.d[id][ids[nmsk]] = 0;
      continue;
    }
    for (int i = 0; i < k; ++i) {
      int nmsk = (msk >> 1);
      if (nmsk & (1 << i)) {
        continue;
      }
      nmsk |= (1 << i);
      res.d[id][ids[nmsk]] = min(res.d[id][ids[nmsk]], c[i]);
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> x >> k >> n >> m;
  for (int msk = 0; msk < (1 << k); ++msk) {
    ids[msk] = -1;
    if (__builtin_popcount(msk) != x) {
      continue;
    }
    ids[msk] = (int)(state.size());
    state.push_back(msk);
  }
  vector<long long> c(k);
  for (auto &e : c) cin >> e;
  vector<int> pos = {0, n - x};
  vector<pair<int, int> > spec(m);
  for (auto &it : spec) {
    cin >> it.first >> it.second;
    it.first--;
    for (int i = 0; i <= k; ++i) {
      int s = it.first - i;
      s = max(s, 0);
      s = min(s, n - x);
      pos.push_back(s);
    }
  }
  sort(pos.begin(), pos.end());
  pos.resize(unique(pos.begin(), pos.end()) - pos.begin());
  vector<Mat> Pw;
  Pw.push_back(make_matrix(c));
  int bit = 0;
  while ((1 << bit) <= n) {
    ++bit;
    Pw.push_back(Pw.back() + Pw.back());
  }
  Mat cur;
  for (int i = 0; i < K; ++i) cur.d[i][i] = 0;
  for (int it = 0; it + 1 < (int)(pos.size()); ++it) {
    int l = pos[it], r = pos[it + 1];
    vector<long long> nc = c;
    for (auto s : spec) {
      if (s.first > l && s.first <= l + k) {
        nc[s.first - l - 1] += s.second;
      }
    }
    if (nc != c) {
      Mat cn = make_matrix(nc);
      cur = cur + cn;
    } else {
      int dif = r - l;
      for (int i = 0; i < (int)(Pw.size()); ++i) {
        if (dif & (1 << i)) {
          cur = cur + Pw[i];
        }
      }
    }
  }
  int fin = (1 << x) - 1;
  fin = ids[fin];
  assert(fin != -1);
  cout << cur.d[fin][fin] << '\n';
  return 0;
}