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;
long long sz[(1 << 8)];
long long D[(1 << 8)][(1 << 8)];
long long MD[32][(1 << 8)][(1 << 8)];
long long c[10];
long long mw[(1 << 8)];
long long who[(1 << 8)];
long long who_n = 0;
long long now[(1 << 8)];
long long want[25 * 30 + 10];
long long made[(1 << 8)];
long long p[55], w[55];
int main() {
  long long x, k, n, q;
  long long i, j, r, o;
  scanf("%lld%lld%lld%lld", &x, &k, &n, &q);
  for (i = 1; i <= k; i++) scanf("%lld", &c[i]);
  for (i = 1; i < (1 << k); i++) sz[i] = sz[i & (i - 1)] + 1;
  for (i = 0; i < (1 << k); i++) {
    for (j = 0; j < (1 << k); j++) {
      D[i][j] = -1;
    }
  }
  for (i = 0; i < (1 << k); i++) {
    if (sz[i] != x) continue;
    who[who_n] = i;
    mw[i] = who_n;
    who_n++;
    long long fo;
    for (j = 0; j < k; j++) {
      if (i & (1 << j)) {
        fo = j;
        break;
      }
    }
    if (fo != 0) {
      D[i][i / 2] = 0;
    }
    for (j = fo + 1; j <= k; j++) {
      if (i & (1 << j)) continue;
      long long next = i - (1 << fo) + (1 << j);
      next /= 2;
      D[i][next] = c[j - fo];
    }
  }
  for (i = 0; i < who_n; i++) {
    for (j = 0; j < who_n; j++) {
      MD[0][i][j] = D[who[i]][who[j]];
    }
  }
  for (i = 1; i < 32; i++) {
    for (j = 0; j < who_n; j++) {
      for (r = 0; r < who_n; r++) {
        MD[i][j][r] = -1;
      }
    }
    for (j = 0; j < who_n; j++) {
      for (r = 0; r < who_n; r++) {
        for (o = 0; o < who_n; o++) {
          if (MD[i - 1][j][o] == -1) continue;
          if (MD[i - 1][o][r] == -1) continue;
          if (MD[i][j][r] == -1 ||
              MD[i][j][r] > MD[i - 1][j][o] + MD[i - 1][o][r])
            MD[i][j][r] = MD[i - 1][j][o] + MD[i - 1][o][r];
        }
      }
    }
  }
  long long want_n = 0;
  for (i = 0; i < q; i++) {
    scanf("%lld%lld", &p[i], &w[i]);
    for (j = p[i] - k - 1; j <= p[i] + 1; j++) {
      if (j > 1) want[want_n++] = j;
    }
  }
  want[want_n++] = n - x + 1;
  sort(want, want + want_n);
  want_n = unique(want, want + want_n) - want;
  long long noww = 1;
  for (i = 0; i < who_n; i++) now[i] = made[i] = -1e13;
  now[mw[(1 << x) - 1]] = 0;
  for (long long pp = 0; pp < want_n; pp++) {
    long long next = want[pp];
    if (next > n - x + 1) break;
    if (next - noww == 1) {
      for (i = 0; i < who_n; i++) {
        if (now[i] == -1e13) continue;
        long long hb = who[i];
        long long fp;
        for (j = 0; j < k; j++) {
          if (hb & (1 << j)) {
            fp = j;
            break;
          }
        }
        if (fp > 0) {
          if (made[mw[hb / 2]] == -1e13 || made[mw[hb / 2]] > now[i])
            made[mw[hb / 2]] = now[i];
        }
        for (j = fp + 1; j <= k; j++) {
          if (hb & (1 << j)) continue;
          long long nb = hb - (1 << fp) + (1 << j);
          nb /= 2;
          long long pls = c[j - fp];
          for (r = 0; r < q; r++) {
            if (p[r] == noww + j) pls += w[r];
          }
          if (made[mw[nb]] == -1e13 || made[mw[nb]] > now[i] + pls)
            made[mw[nb]] = now[i] + pls;
        }
      }
      for (i = 0; i < who_n; i++) {
        now[i] = made[i];
        made[i] = -1e13;
      }
    } else {
      long long delta = next - noww;
      for (i = 0; i < 30; i++) {
        if ((delta & ((long long)1 << i)) == 0) continue;
        for (j = 0; j < who_n; j++) {
          if (now[j] == -1e13) continue;
          for (r = 0; r < who_n; r++) {
            if (MD[i][j][r] == -1) continue;
            if (made[r] == -1e13 || made[r] > now[j] + MD[i][j][r])
              made[r] = now[j] + MD[i][j][r];
          }
        }
        for (j = 0; j < who_n; j++) {
          now[j] = made[j];
          made[j] = -1e13;
        }
      }
    }
    noww = want[pp];
  }
  printf("%lld", now[0]);
  return 0;
}