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 w[100], cnt, mp[1 << 8];
vector<int> cs;
struct node {
  int pos, w, l, r;
  inline friend bool operator<(const node a, const node b) {
    return a.pos < b.pos;
  }
} st[105];
struct Vector {
  long long c[105];
  inline void out() {
    for (int i = 0; i < cnt; ++i) cout << c[i] << endl;
  }
  inline void C() { memset(c, 0x3f, sizeof c); }
} F;
struct Matrix {
  long long c[105][105];
  inline void C() { memset(c, 0x3f, sizeof c); }
  inline void I() {
    C();
    for (int i = 0; i < cnt; ++i) c[i][i] = 1;
  }
  inline void out() {
    for (int i = 0; i < cnt; ++i, puts(""))
      for (int j = 0; j < cnt; ++j) cout << c[i][j] << ' ';
  }
  inline friend Matrix operator*(const Matrix a, const Matrix b) {
    Matrix c;
    c.C();
    for (int k = 0; k < cnt; ++k)
      for (int i = 0; i < cnt; ++i)
        for (int j = 0; j < cnt; ++j)
          c.c[i][j] = min(c.c[i][j], a.c[i][k] + b.c[k][j]);
    return c;
  }
} G[30], T;
void operator*=(Vector &a, Matrix b) {
  Vector c;
  c.C();
  for (int i = 0; i < cnt; ++i)
    for (int j = 0; j < cnt; ++j) c.c[j] = min(c.c[j], b.c[j][i] + a.c[i]);
  a = c;
  return;
}
inline void solve(int x) {
  for (int i = 29; ~i; --i)
    if ((x >> i) & 1) F *= G[i];
}
int main() {
  int x, k, n, q;
  cin >> x >> k >> n >> q;
  for (int i = 1; i <= k; ++i) cin >> w[i];
  for (int i = 1; i <= q; ++i) cin >> st[i].pos >> st[i].w;
  sort(st + 1, st + q + 1);
  for (int i = 1; i < 1 << k; ++i) {
    int t = 0;
    for (int j = 0; j < k; ++j)
      if ((i >> j) & 1) ++t;
    if (t == x) cs.push_back(i), mp[i] = cs.size() - 1;
  }
  cnt = cs.size(), G[0].C();
  for (int i = 0; i < cnt; ++i) {
    int x = cs[i];
    if (x & 1)
      for (int j = 1; j <= k; ++j) {
        if (!((x >> j) & 1)) G[0].c[mp[(x | 1 << j) >> 1]][i] = w[j];
      }
    else
      G[0].c[mp[x >> 1]][i] = 0;
  }
  for (int i = 1; i < 30; ++i) G[i] = G[i - 1] * G[i - 1];
  F.C();
  F.c[mp[(1 << x) - 1]] = 0;
  int las = 0;
  for (int i = 1; i <= q; ++i) st[i].l = st[i].pos - k, st[i].r = st[i].pos - 1;
  for (int i = 1; i <= q; ++i) {
    solve(max(0, st[i].pos - k - 1 - las));
    int L = max(las + 1, st[i].pos - k), R = min(st[i].pos - 1, n - x);
    for (int j = L; j <= R; ++j) {
      T.C();
      for (int l = 0; l < cnt; ++l) {
        int x = cs[l];
        if (x & 1)
          for (int e = 1; e <= k; ++e) {
            if (!((x >> e) & 1)) {
              T.c[mp[(x | 1 << e) >> 1]][l] = w[e];
              for (int et = i; et <= q; ++et)
                if (j + e == st[et].pos)
                  T.c[mp[(x | 1 << e) >> 1]][l] += st[et].w;
            }
          }
        else
          T.c[mp[x >> 1]][l] = 0;
      }
      F *= T;
    }
    las = st[i].pos - 1;
  }
  solve(max(0, n - x - las));
  cout << F.c[mp[(1 << x) - 1]] << endl;
  return 0;
}