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;
int mod = 1000000007LL;
long long large = 2000000000000000000LL;
int sz = 0;
int x, k, n, q;
map<int, int> comp;
vector<int> mask;
vector<long long> c;
vector<vector<long long> > g;
vector<pair<int, long long> > w;
vector<vector<long long> > mul(vector<vector<long long> > a,
                               vector<vector<long long> > b) {
  vector<vector<long long> > c(sz, vector<long long>(sz, large));
  for (int i = 0; i < sz; i++) {
    for (int j = 0; j < sz; j++) {
      for (int k = 0; k < sz; k++) {
        c[i][j] = min(c[i][j], a[i][k] + b[k][j]);
      }
    }
  }
  return c;
}
vector<vector<long long> > power(vector<vector<long long> > a, long long x) {
  vector<vector<long long> > ans(sz, vector<long long>(sz, large));
  for (int i = 0; i < sz; i++) ans[i][i] = 0;
  while (x) {
    if (x & 1) {
      ans = mul(ans, a);
    }
    a = mul(a, a);
    x >>= 1;
  }
  return ans;
}
string getmask(int x) {
  string s = "";
  for (int i = 0; i < k; i++) {
    if (x & (1 << i))
      s.push_back('1');
    else
      s.push_back('0');
  }
  return s;
}
vector<long long> mul2(vector<long long> b, vector<vector<long long> > a) {
  vector<long long> c(sz, large);
  for (int i = 0; i < sz; i++) {
    for (int j = 0; j < sz; j++) {
      c[i] = min(c[i], b[j] + a[j][i]);
    }
  }
  return c;
}
map<int, int> comp2;
vector<long long> get1(vector<long long> b, int pos) {
  vector<long long> re(sz, large);
  for (int i = 0; i < sz; i++) {
    int m = mask[i];
    if (m & 1) {
      m >>= 1;
      for (int j = 0; j < k; j++) {
        if ((m & (1 << j)) == 0) {
          int nmask = m ^ (1 << j);
          long long cost = b[i] + c[j];
          if (comp2.find(pos + 1 + j) != comp2.end()) {
            cost += w[comp2[pos + 1 + j]].second;
          }
          re[comp[nmask]] = min(re[comp[nmask]], cost);
        }
      }
    } else {
      re[comp[m >> 1]] = min(re[comp[m >> 1]], b[i]);
    }
  }
  return re;
}
int main() {
  cin >> x >> k >> n >> q;
  c.assign(k, 0);
  for (int i = 0; i < k; i++) cin >> c[i];
  for (int i = 0; i < (1 << k); i++) {
    int cnt = 0;
    for (int j = 0; j < k; j++) {
      if (i & (1 << j)) cnt++;
    }
    if (cnt == x) {
      comp[i] = sz++;
      mask.push_back(i);
    }
  }
  g.assign(sz, vector<long long>(sz, large));
  for (int i = 0; i < sz; i++) {
    int m = mask[i];
    if (m & 1) {
      m >>= 1;
      for (int j = 0; j < k; j++) {
        if ((m & (1 << j)) == 0) {
          int nmask = m ^ (1 << j);
          g[i][comp[nmask]] = c[j];
        }
      }
    } else {
      g[i][comp[m >> 1]] = 0;
    }
  }
  for (int i = 0; i < q; i++) {
    int a;
    long long b;
    cin >> a >> b;
    a--;
    w.push_back(pair<int, long long>(a, b));
  }
  sort(w.begin(), w.end());
  for (int i = 0; i < q; i++) {
    comp2[w[i].first] = i;
  }
  vector<int> ind;
  ind.push_back(0);
  for (int i = 0; i < q; i++) {
    int p = w[i].first;
    for (int j = p - k; j <= p; j++) {
      int t = max(j, 0);
      ind.push_back(t);
    }
  }
  ind.push_back(n - x);
  sort(ind.begin(), ind.end());
  ind.erase(unique(ind.begin(), ind.end()), ind.end());
  while (ind.back() > n - x) ind.pop_back();
  vector<vector<long long> > re((int)ind.size(), vector<long long>());
  re[0] = vector<long long>(sz, large);
  re[0][comp[(1 << x) - 1]] = 0;
  for (int i = 1; i < (int)ind.size(); i++) {
    if (ind[i - 1] == ind[i] - 1) {
      re[i] = get1(re[i - 1], ind[i - 1]);
    } else {
      re[i] = mul2(re[i - 1], power(g, ind[i] - ind[i - 1]));
    }
  }
  cout << re.back()[comp[(1 << x) - 1]] << endl;
  return 0;
}