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>
const int maxk = 10;
const long long INF = 1e18;
struct node {
  int p, wp;
  bool operator<(const node &tmp) const { return p < tmp.p; }
};
struct node ai[35];
int n, id[1 << maxk], x, k, q, ci[maxk], num, S[105];
long long f[105][105][32], dp[30][105], g[105];
inline void read(int &now) {
  char Cget;
  now = 0;
  int if_z = 1;
  while (!isdigit(Cget = getchar()))
    if (Cget == '-') if_z = -1;
  while (isdigit(Cget)) {
    now = now * 10 + Cget - '0';
    Cget = getchar();
  }
  now *= if_z;
}
inline int count(int s) {
  int res = 0;
  while (s > 0) {
    if (s & 1) ++res;
    s >>= 1;
  }
  return res;
}
int main() {
  read(x);
  read(k);
  read(n);
  read(q);
  for (int i = 1; i <= k; i++) read(ci[i]);
  for (int i = 0; i < (1 << k); i++)
    if (count(i) == x) {
      id[i] = ++num;
      S[num] = i;
    }
  for (int i = 1; i <= num; i++)
    for (int v = 1; v <= num; v++)
      for (int e = 0; e <= 30; e++) f[i][v][e] = INF;
  for (int i = 1, s, s_; i <= num; i++) {
    s = S[i];
    if (s & 1) {
      s_ = s >> 1;
      for (int v = 0; v < k; v++)
        if (!(s_ & (1 << v))) f[id[s]][id[s_ | (1 << v)]][0] = ci[v + 1];
    } else
      f[id[s]][id[s >> 1]][0] = 0;
  }
  for (int i = 1; i <= 30; i++)
    for (int s = 1; s <= num; s++)
      for (int t = 1; t <= num; t++)
        for (int e = 1; e <= num; e++)
          if (f[s][e][i - 1] != INF && f[e][t][i - 1] != INF &&
              f[s][e][i - 1] + f[e][t][i - 1] < f[s][t][i])
            f[s][t][i] = f[s][e][i - 1] + f[e][t][i - 1];
  for (int i = 1; i <= q; i++) {
    read(ai[i].p);
    read(ai[i].wp);
  }
  std::sort(ai + 1, ai + q + 1);
  ai[0].p = 1;
  long long tmpans = 0;
  while (ai[q].p > n - x + 1 && q > 0) tmpans += ai[q--].wp;
  if (ai[q].p < n - x + 1) {
    ai[++q].p = n - x + 1;
    ai[q].wp = 0;
  }
  memset(dp, 0x3f, sizeof(dp));
  dp[0][1] = 0;
  for (int i = 1; i <= q; i++) {
    int tmp = ai[i].p - ai[i - 1].p;
    for (int v = 1; v <= num; v++) dp[i][v] = dp[i - 1][v];
    for (int v = 0; v <= 30; v++)
      if ((1 << v) & tmp) {
        memset(g, 0x3f, sizeof(g));
        for (int e = 1; e <= num; e++)
          for (int z = 1; z <= num; z++)
            if (dp[i][e] <= INF && f[e][z][v] <= INF)
              g[z] = std::min(dp[i][e] + f[e][z][v], g[z]);
        for (int e = 1; e <= num; e++) dp[i][e] = g[e];
      }
    for (int v = 1; v <= num; v++) {
      int s = S[v];
      if ((s & 1) && dp[i][v] < INF) dp[i][v] += ai[i].wp;
    }
  }
  std::cout << dp[q][1] + tmpans;
  return 0;
}