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 N = 1e5 + 10;
const int K = 70 + 5;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const int A = 1e8 + 5;
int s, m, n, q, sz, finalMask, now, nxt, posSize = 0;
int a[K], ID[1 << 10], pos[K];
long long f[K];
long long dp[2][K];
vector<int> M;
map<int, int> b;
struct Matrix {
  long long a[K + 5][K + 5];
  Matrix() { memset(a, INF, sizeof a); }
  Matrix operator*(const Matrix &that) const {
    Matrix ans;
    for (int i = 0; i < sz; ++i)
      for (int j = 0; j < sz; ++j)
        for (int k = 0; k < sz; ++k)
          ans.a[i][j] = min(ans.a[i][j], a[i][k] + that.a[k][j]);
    return ans;
  }
} O;
Matrix Power(Matrix a, long long p) {
  Matrix ans = a;
  --p;
  while (p) {
    if (p & 1) ans = ans * a;
    a = a * a;
    p >>= 1;
  }
  return ans;
}
void InitMatrix() {
  for (int i = 0; i < M.size(); ++i) {
    int mask = M[i];
    if (mask >> 0 & 1) {
      for (int j = 1; j <= m; ++j)
        if ((mask >> j & 1) == 0) {
          int newMask = (mask | (1 << j)) >> 1;
          int x = ID[mask], y = ID[newMask];
          O.a[x][y] = min(O.a[x][y], (long long)a[j]);
        }
    } else {
      int x = ID[mask], y = ID[mask >> 1];
      O.a[x][y] = min(O.a[x][y], 0LL);
    }
  }
}
void JumpMatrix(int Len) {
  if (Len <= 0) return;
  Matrix ans;
  for (int i = 0; i < sz; ++i) f[i] = dp[now][i];
  Matrix P = Power(O, Len);
  for (int i = 0; i < sz; ++i) dp[now][i] = INF;
  for (int i = 0; i < sz; ++i)
    for (int j = 0; j < sz; ++j) dp[now][i] = min(dp[now][i], f[j] + P.a[j][i]);
}
long long Cost(int p) {
  if (b.count(p))
    return b[p];
  else
    return 0;
}
void JumpDP(int p, int banPos) {
  for (int timer = max(p, banPos - m); timer < min(n - s + 1, banPos);
       ++timer) {
    for (int i = 0; i < sz; ++i) dp[nxt][i] = INF;
    for (int i = 0; i < M.size(); ++i) {
      int mask = M[i];
      if (mask >> 0 & 1) {
        for (int j = 1; j <= m; ++j)
          if ((mask >> j & 1) == 0) {
            int newMask = (mask | (1 << j)) >> 1;
            int x = ID[mask], y = ID[newMask];
            dp[nxt][y] = min(dp[nxt][y], dp[now][x] + a[j] + Cost(timer + j));
          }
      } else {
        int x = ID[mask], y = ID[mask >> 1];
        dp[nxt][y] = min(dp[nxt][y], dp[now][x]);
      }
    }
    now ^= 1;
    nxt ^= 1;
  }
}
int main() {
  scanf("%d%d%d%d", &s, &m, &n, &q);
  for (int i = 1; i <= m; ++i) scanf("%d", &a[i]);
  posSize = 0;
  for (int i = 1; i <= q; ++i) {
    int p, v;
    scanf("%d%d", &p, &v);
    b[p] = v;
    pos[++posSize] = p;
  }
  sort(pos + 1, pos + posSize + 1);
  memset(dp, INF, sizeof dp);
  int d = 0;
  for (int mask = 0; mask < 1 << m; ++mask)
    if (__builtin_popcount(mask) == s) {
      M.push_back(mask);
      ID[mask] = d++;
    }
  finalMask = ID[(1 << s) - 1];
  sz = M.size();
  InitMatrix();
  now = 0;
  nxt = 1;
  dp[now][finalMask] = 0;
  int p = 1;
  for (int i = 1; i <= posSize; ++i) {
    int banPos = pos[i];
    JumpMatrix(banPos - m - p);
    JumpDP(p, banPos);
    p = banPos;
  }
  JumpMatrix(n - s - p + 1);
  cout << dp[now][ID[(1 << s) - 1]];
  return 0;
}