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 int inf = (int)1e9;
const long long linf = (long long)1e18;
const int mod = (int)1e9 + 7;
const long double eps = (long double)1e-8;
const int maxn = (int)1e5 + 5;
const long double pi = acos(-1);
int rmask[333];
vector<vector<long long> > cper, per, d[111];
vector<pair<long long, long long> > obs;
int n, k, first, Q, cnt, u[1111];
long long c[11];
void initmat(vector<vector<long long> >& p, int n, int m) {
  p.resize(n);
  for (auto i = 0; i < n; ++i) {
    p[i].assign(m, 0);
  }
}
void mult(vector<vector<long long> >& a, vector<vector<long long> >& b,
          vector<vector<long long> >& c) {
  vector<vector<long long> > d;
  assert(((int)(b).size()));
  assert(((int)(a).size()));
  int n = ((int)(a).size()), m = ((int)(a[0]).size()), k = ((int)(b[0]).size());
  assert(((int)(b).size()) == m);
  initmat(d, n, k);
  for (auto i = 0; i < n; ++i)
    for (auto j = 0; j < k; ++j) {
      d[i][j] = linf;
      for (auto q = 0; q < m; ++q) {
        d[i][j] = min(d[i][j], a[i][q] + b[q][j]);
      }
    }
  c = d;
}
void matpw(int z, int st) {
  initmat(d[z], cnt, cnt);
  if (st == 0) {
    for (auto i = 0; i < cnt; ++i)
      for (auto j = 0; j < cnt; ++j) {
        if (i == j)
          d[z][i][j] = 0;
        else
          d[z][i][j] = linf;
      }
    return;
  }
  if (st & 1) {
    matpw(z + 1, st - 1);
    mult(d[z + 1], per, d[z]);
    return;
  }
  matpw(z + 1, st / 2);
  mult(d[z + 1], d[z + 1], d[z]);
}
void out(vector<vector<long long> >& a) {
  cout << "out:" << endl;
  for (auto i = 0; i < ((int)(a).size()); ++i) {
    for (auto j = 0; j < ((int)(a[i]).size()); ++j) cout << a[i][j] << " ";
    cout << endl;
  }
  cout << "end" << endl;
}
void init() {
  cnt = 0;
  for (auto i = 0; i < (1 << k); ++i) {
    int cnt1 = 0;
    for (auto j = 0; j < k; ++j)
      if (i & (1 << j)) ++cnt1;
    if (cnt1 == first) {
      rmask[cnt] = i;
      u[i] = cnt;
      ++cnt;
    }
  }
  initmat(per, cnt, cnt);
  for (auto mfrom = 0; mfrom < cnt; ++mfrom) {
    for (auto mto = 0; mto < cnt; ++mto) {
      per[mto][mfrom] = linf;
    }
    int rmfrom = rmask[mfrom];
    if (rmfrom & 1) {
      for (auto i = 0; i < k; ++i) {
        int mto = (rmfrom >> 1);
        if (mto & (1 << i)) continue;
        mto |= (1 << i);
        per[u[mto]][mfrom] = c[i];
      }
    } else {
      per[u[rmfrom >> 1]][mfrom] = 0;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> first >> k >> n >> Q;
  for (auto i = 0; i < k; ++i) {
    cin >> c[i];
  }
  for (auto i = 0; i < Q; ++i) {
    int x, y;
    cin >> x >> y;
    obs.push_back({x, y});
  }
  obs.push_back({n + 1, 0});
  sort((obs).begin(), (obs).end());
  init();
  vector<vector<long long> > st(cnt);
  for (auto i = 0; i < cnt; ++i) {
    st[i].resize(1);
    st[i][0] = linf;
  }
  st[0][0] = 0;
  int l = 1;
  for (auto q = 0; q < Q + 1; ++q) {
    int r = obs[q].first - k;
    if (l >= obs[q].first) continue;
    int from;
    if (r - l < 0) {
      from = l;
    } else {
      from = r;
      matpw(0, r - l);
      mult(d[0], st, st);
    }
    l = from;
    for (auto i = from; i < inf; ++i) {
      if (i == n - first + 1) {
        for (auto j = 0; j < cnt; ++j) {
          int msk = rmask[j];
          int fl = 1;
          for (auto w = 0; w < first; ++w)
            if (!(msk & (1 << w))) {
              fl = 0;
              break;
            }
          if (fl) {
            cout << st[j][0] << endl;
            exit(0);
          }
        }
      }
      int fl = 0;
      cper = per;
      for (auto w = 0; w < Q + 1; ++w) {
        if (obs[w].first >= l + 1 && obs[w].first <= l + k) {
          fl = 1;
          int pos = obs[w].first - (l + 1);
          for (auto mfrom = 0; mfrom < cnt; ++mfrom) {
            for (auto mto = 0; mto < cnt; ++mto) {
              int rmfrom = rmask[mfrom];
              int rmto = rmask[mto];
              if (!(rmfrom & (1 << (pos + 1))) && (rmto & (1 << pos)))
                cper[mto][mfrom] += obs[w].second;
            }
          }
        }
      }
      if (!fl) {
        break;
      }
      mult(cper, st, st);
      ++l;
    }
  }
  return 0;
}