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;
template <class T>
T smin(T &a, T b) {
  if (a > b) a = b;
  return a;
}
template <class T>
T smax(T &a, T b) {
  if (a < b) a = b;
  return a;
}
long long D[30][1 << 9][1 << 9];
long long c[22];
const long long oo = 2e18;
vector<long long> Mask;
long long W[1 << 10];
map<long long, long long> M;
long long dp[1 << 9];
long long nd[1 << 9];
vector<pair<long long, long long> > g[1 << 9];
long long brute(long long m, long long k, long long n,
                vector<pair<long long, long long> > v) {
  static long long ss[2][1 << 9];
  static map<long long, long long> M;
  for (auto it : v) M[it.first] = it.second;
  const long long N = 1 << k;
  for (long long i = 0; i < N; ++i) ss[0][i] = oo;
  ss[0][(1 << m) - 1] = 0;
  for (long long t = 1; t <= n - m; ++t) {
    for (long long mask = 0; mask < N; ++mask) ss[1][mask] = oo;
    for (long long mask = 0; mask < N; ++mask)
      if (ss[0][mask] != oo) {
        if (!(mask & 1))
          smin(ss[1][mask / 2], ss[0][mask]);
        else {
          for (long long j = 1; j <= k; ++j)
            if (!((mask >> j) & 1)) {
              const long long nmask = (mask / 2) | (1 << (j - 1));
              long long add = c[j];
              if (M.count(t + j)) add += M[t + j];
              smin(ss[1][nmask], ss[0][mask] + add);
            }
        }
      }
    for (long long mask = 0; mask < N; ++mask) ss[0][mask] = ss[1][mask];
  }
  return ss[0][(1 << m) - 1];
}
const long long DEBUG = 1;
int32_t main(void) {
  srand(time(0));
  long long m, k, n, q;
  cin >> m >> k >> n >> q;
  if (DEBUG) {
    for (long long i = 1; i <= k; ++i) cin >> c[i];
  } else {
    for (long long i = 1; i <= k; ++i) c[i] = rand() % 1000000000 + 1;
  }
  const long long N = (1 << k);
  for (long long mask = 0; mask < N; ++mask)
    if (__builtin_popcount(mask) == m)
      Mask.push_back(mask), W[mask] = Mask.size() - 1;
  const long long sz = Mask.size();
  for (long long t = 0; t < 30; ++t)
    for (long long i = 0; i < sz; ++i)
      for (long long j = 0; j < sz; ++j) D[t][i][j] = oo;
  for (long long i = 0; i < sz; ++i) {
    if (!(Mask[i] & 1))
      g[i].push_back(make_pair(W[Mask[i] / 2], 0));
    else
      for (long long j = 1; j <= k; ++j)
        if (!((Mask[i] >> j) & 1))
          g[i].push_back(make_pair(W[(Mask[i] / 2) ^ (1 << (j - 1))], j));
  }
  for (long long i = 0; i < sz; ++i)
    for (auto it : g[i]) D[0][i][it.first] = c[it.second];
  for (long long t = 1; t < 30; ++t)
    for (long long kk = 0; kk < sz; ++kk)
      for (long long i = 0; i < sz; ++i)
        for (long long j = 0; j < sz; ++j)
          smin(D[t][i][j], D[t - 1][i][kk] + D[t - 1][kk][j]);
  for (long long i = 0; i < sz; ++i) dp[i] = oo;
  vector<pair<long long, long long> > v(q);
  if (DEBUG) {
    for (auto &it : v) cin >> it.first >> it.second, M[it.first] = it.second;
  } else {
    for (auto &it : v)
      it.first = rand() % (n - m) + m + 1,
      it.second = rand() % 2000000001 - 1000000000, M[it.first] = it.second;
  }
  v.push_back(make_pair(n, 0));
  sort(v.begin(), v.end());
  for (long long i = 0; i + 1 < q; ++i) assert(v[i].first != v[i + 1].first);
  reverse(v.begin(), v.end());
  dp[W[(1 << m) - 1]] = 0;
  long long last = 1;
  while (last <= n - m) {
    for (long long i = 0; i < sz; ++i) nd[i] = oo;
    if (!v.empty() && last < v.back().first - k) {
      long long mv = v.back().first - k - last;
      mv = mv & (-mv);
      long long lg = 0;
      while ((1 << lg) < mv) ++lg;
      for (long long i = 0; i < sz; ++i)
        for (long long j = 0; j < sz; ++j) smin(nd[j], dp[i] + D[lg][i][j]);
      last += (1 << lg);
    } else {
      for (long long i = 0; i < sz; ++i)
        for (auto it : g[i]) {
          if (it.second && M.count(last + it.second))
            smin(nd[it.first], dp[i] + c[it.second] + M[last + it.second]);
          else
            smin(nd[it.first], dp[i] + c[it.second]);
        }
      ++last;
    }
    for (long long i = 0; i < sz; ++i) dp[i] = nd[i];
    while (!v.empty() && last > v.back().first) v.pop_back();
  }
  cout << dp[W[(1 << m) - 1]] << '\n';
  return 0;
}