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 long long inf = 2e18;
int n, m, l, t;
long long ma[10], ta[30], tca[30];
pair<long long, long long> tt[30];
long long dist[30][1 << 8][1 << 8];
vector<int> cs;
void getDist() {
  for (int i = 0; i < 1 << m; i++) {
    int c = 0;
    for (int j = 0; j < m; j++)
      if (i >> j & 1) c++;
    if (c == n) cs.push_back(i);
  }
  for (int d = 0; d < 30; d++)
    for (int i = 0; i < 1 << m; i++)
      for (int j = 0; j < 1 << m; j++) dist[d][i][j] = inf;
  for (auto i : cs) {
    int nx, mp = 0;
    for (;; mp++) {
      if (i >> mp & 1) break;
    }
    nx = (i ^ (1 << mp)) >> 1;
    for (int j = 0; j < m - mp; j++)
      if (!(nx & 1 << (j + mp))) {
        int tmp = nx | 1 << (j + mp);
        dist[0][i][tmp] = min(dist[0][i][tmp], ma[j]);
      }
    if (mp != 0) dist[0][i][i >> 1] = min(dist[0][i][1 >> i], 0ll);
  }
  for (int d = 1; d < 30; d++)
    for (auto i : cs)
      for (auto j : cs)
        for (auto k : cs) {
          dist[d][i][k] =
              min(dist[d][i][k], dist[d - 1][i][j] + dist[d - 1][j][k]);
        }
}
long long cur[1 << 8];
set<int> tr, co;
map<int, long long> vtr;
void moX(long long d, int b) {
  long long tmp[1 << 8];
  for (int di = 0; d >> di; di++) {
    if (d >> di & 1) {
      for (int i = 0; i < 1 << m; i++) tmp[i] = inf;
      for (auto i : cs)
        for (auto j : cs) {
          long long cost = cur[i] + dist[di][i][j];
          if (d == 1 && di == 0) {
            for (int k = 0; k < m; k++) {
              if ((j >> k & 1) && !(i >> (k + 1) & 1) &&
                  co.find(b + k) != co.end()) {
                cost += vtr[b + k];
              }
            }
          }
          tmp[j] = min(tmp[j], cost);
        }
      for (int i = 0; i < 1 << m; i++) cur[i] = tmp[i];
    }
  }
}
void solve() {
  for (int i = 0; i < 1 << m; i++) cur[i] = inf;
  cur[(1 << n) - 1] = 0;
  for (int i = 0; i < t; i++) {
    co.insert(ta[i]);
    vtr[ta[i]] = tca[i];
    for (int j = max(1ll, ta[i] - m); j <= ta[i]; j++) tr.insert(j);
  }
  tr.insert(l - n + 1);
  int cp = 1;
  for (auto &np : tr) {
    if (cp == np) continue;
    if (np > l - n + 1) break;
    moX(np - cp, np);
    cp = np;
  }
}
int main() {
  scanf("%d%d%d%d", &n, &m, &l, &t);
  for (int i = 0; i < m; i++) scanf("%lld", ma + i);
  for (int i = 0; i < t; i++) scanf("%lld%lld", ta + i, tca + i);
  for (int i = 0; i < t; i++) tt[i] = pair<long long, long long>(ta[i], tca[i]);
  sort(tt, tt + t);
  for (int i = 0; i < t; i++) ta[i] = tt[i].first, tca[i] = tt[i].second;
  getDist();
  solve();
  printf("%lld\n", cur[(1 << n) - 1]);
  return 0;
}