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 X, K, n, m, q;
const long long inf = 1e18;
struct Mat {
  long long a[73][73];
  Mat() {
    for (int i = 1; i <= 70; i++)
      for (int j = 1; j <= 70; j++) a[i][j] = inf;
  }
  Mat operator*(const Mat &b) {
    Mat ans;
    for (int k = 1; k <= m; k++)
      for (int i = 1; i <= m; i++)
        for (int j = 1; j <= m; j++)
          ans.a[i][j] = min(ans.a[i][j], a[i][k] + b.a[k][j]);
    return ans;
  }
} base, f;
Mat pow(Mat a, int b) {
  Mat ans, tmp = a;
  for (int i = 1; i <= m; i++) ans.a[i][i] = 0;
  while (b) {
    if (b & 1) ans = ans * tmp;
    tmp = tmp * tmp;
    b >>= 1;
  }
  return ans;
}
int state[266], ls, who[73];
struct Ran {
  int l, r;
} qq[33], ran[33];
int len;
long long g[73], h[73];
int cost[12];
struct Block {
  int pos, w;
} ww[33];
bool cmpww(const Block &a, const Block &b) { return a.pos < b.pos; }
struct Hash {
  int first[107], le;
  struct Edge {
    int to, v, next;
  } edge[33];
  Hash() { le = 2; }
  void insert(int x, int y) {
    int h = x % 107;
    Edge &e = edge[le];
    e.to = x;
    e.v = y;
    e.next = first[h];
    first[h] = le++;
  }
  int find(int x) {
    int h = x % 107;
    for (int i = first[h]; i; i = edge[i].next)
      if (edge[i].to == x) return edge[i].v;
    return -2e9;
  }
} ha;
int main() {
  scanf("%d%d%d%d", &X, &K, &n, &q);
  for (int i = 1; i <= K; i++) scanf("%d", &cost[i]);
  for (int i = 1; i <= q; i++) scanf("%d%d", &ww[i].pos, &ww[i].w);
  sort(ww + 1, ww + 1 + q, cmpww);
  long long ans = 0;
  for (int &i = q; i; i--)
    if (ww[i].pos >= n - X + 1)
      ans += ww[i].w;
    else
      break;
  for (int i = 1; i <= q; i++) ha.insert(ww[i].pos, ww[i].w);
  for (int i = 1; i <= q; i++)
    qq[i].l = max(ww[i].pos - K, 2), qq[i].r = ww[i].pos;
  len = 0;
  for (int i = 1; i <= q; i++) {
    if (len && qq[i].l <= ran[len].r + 1)
      ran[len].r = qq[i].r;
    else
      len++, ran[len].l = qq[i].l, ran[len].r = qq[i].r;
  }
  ls = 0;
  for (int i = 1; i < (1 << K); i++) {
    int cnt = 0;
    for (int j = 0; j < K; j++)
      if ((i >> j) & 1) cnt++;
    if (cnt == X) ls++, state[i] = ls, who[ls] = i;
  }
  m = ls;
  for (int i = 1; i <= ls; i++) {
    int s = who[i] >> 1;
    if ((who[i] & 1) == 0)
      base.a[i][state[s]] = 0;
    else
      for (int j = 1; j <= K; j++)
        if (((s >> (j - 1)) & 1) == 0)
          base.a[i][state[s | (1 << (j - 1))]] = cost[j];
  }
  f.a[1][1] = 0;
  ran[0].r = 1;
  for (int i = 1; i <= len; i++) {
    f = f * pow(base, ran[i].l - ran[i - 1].r - 1);
    for (int j = 1; j <= ls; j++) g[j] = f.a[1][j];
    for (int j = ran[i].l; j <= ran[i].r; j++) {
      for (int k = 1; k <= ls; k++) h[k] = inf;
      for (int k = 1; k <= ls; k++) {
        int s = who[k] >> 1;
        if ((who[k] & 1) == 0)
          h[state[s]] = min(h[state[s]], g[k]);
        else
          for (int l = 1, tmp; l <= K; l++)
            if (((s >> (l - 1)) & 1) == 0) {
              int ns = s | (1 << (l - 1));
              if ((tmp = ha.find(j + l - 1)) != -2e9)
                h[state[ns]] = min(h[state[ns]], g[k] + cost[l] + tmp);
              else
                h[state[ns]] = min(h[state[ns]], g[k] + cost[l]);
            }
      }
      for (int k = 1; k <= ls; k++) g[k] = h[k];
    }
    for (int j = 1; j <= ls; j++) f.a[1][j] = g[j];
  }
  f = f * pow(base, n - X + 1 - ran[len].r);
  printf("%lld\n", ans + f.a[1][1]);
  return 0;
}