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 defK = 8;
const int pk = 1 << defK;
const int mask = pk - 1;
long long aux[pk][pk];
long long vv;
struct matrix {
  long long data[pk][pk];
  void init() {
    static int i, j;
    for (i = 0; i < pk; i++)
      for (j = 0; j < pk; j++) data[i][j] = 1LL << 60;
  }
  matrix() { init(); }
  void operator*=(matrix who) {
    static int i, j, k;
    memcpy(aux, data, sizeof(aux));
    for (i = 0; i < pk; i++)
      for (j = 0; j < pk; j++) data[i][j] = 1LL << 60;
    for (k = 0; k < pk; k++) {
      for (i = 0; i < pk; i++) {
        if (aux[i][k] >= 1LL << 60) continue;
        for (j = 0; j < pk; j++) {
          data[i][j] = min(data[i][j], aux[i][k] + who.data[k][j]);
        }
      }
    }
  }
  void mult2(matrix& who) {
    static int i, j, k;
    memcpy(aux, data, sizeof(aux));
    for (i = 0; i < pk; i++)
      for (j = 0; j < pk; j++) data[i][j] = 1LL << 60;
    for (k = 0; k < pk; k++) {
      for (i = 0; i < pk; i++) {
        if (aux[i][k] >= 1LL << 60) continue;
        for (j = 0; j < pk; j++) {
          data[i][j] = min(data[i][j], aux[i][k] + who.data[k][j]);
        }
      }
    }
  }
  void mult(matrix who) {
    static int i, j, k;
    memcpy(aux, data, sizeof(aux));
    for (i = 0; i < pk; i++)
      for (j = 0; j < pk; j++) data[i][j] = 1LL << 60;
    for (k = 0; k < pk; k++) {
      for (i = vv; i <= vv; i++) {
        if (aux[i][k] >= 1LL << 60) continue;
        for (j = 0; j < pk; j++) {
          data[i][j] = min(data[i][j], aux[i][k] + who.data[k][j]);
        }
      }
    }
  }
};
matrix def[31];
int x, k, n, q, i, j, p;
long long c[11], pos, val;
map<long long, long long> M;
vector<long long> need;
matrix base;
matrix temp;
long long wh, to;
matrix act;
void make_base(matrix& base) {
  int conf, nxt, i;
  base.init();
  for (conf = 0; conf < pk; conf++) {
    nxt = conf << 1;
    if ((nxt & pk) == 0) {
      base.data[conf][nxt] = 0;
    } else {
      nxt ^= pk;
      for (i = 0; i < defK; i++) {
        if (nxt & (1 << i)) continue;
        base.data[conf][nxt | (1 << i)] = c[8 - i];
      }
    }
  }
}
void make_temp(int r_pos) {
  int i;
  for (i = 1; i <= defK; i++) c[i] += M[r_pos - defK + i];
  make_base(temp);
  for (i = 1; i <= defK; i++) c[i] -= M[r_pos - defK + i];
}
void poww(matrix& sol, long long b) {
  int i;
  i = 0;
  while (b > 0) {
    if (b & 1) sol.mult(def[i]);
    b >>= 1;
    i++;
  }
}
int main() {
  scanf("%d%d%d%d", &x, &k, &n, &q);
  for (i = 1; i <= k; i++) scanf("%lld", &c[i]);
  for (i = 1; i <= q; i++) {
    scanf("%lld%lld", &pos, &val);
    M[pos] = val;
    for (j = 0; j < defK; j++) need.push_back(pos + j);
  }
  while (k < defK) c[++k] = 1LL << 60;
  make_base(base);
  def[0] = base;
  for (i = 1; i <= 30; i++) {
    def[i] = def[i - 1];
    def[i] *= def[i];
  }
  sort(need.begin(), need.end());
  need.resize(unique(need.begin(), need.end()) - need.begin());
  act.init();
  vv = ((1 << x) - 1) << (k - x);
  act.data[vv][vv] = 0;
  need.push_back(n + 300);
  for (p = 0; need[p] <= k; p++)
    ;
  wh = k;
  while (wh < n + k - x) {
    if (need[p] == wh + 1) {
      make_temp(wh + 1);
      act.mult(temp);
      p++;
      wh++;
    } else {
      to = min(1LL * n + k - x, need[p] - 1);
      poww(act, to - wh);
      wh = to;
    }
  }
  printf("%lld", act.data[vv][vv]);
  return 0;
}