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 INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3fll;
const long long M = 1e9 + 7;
const long long maxn = 1000 + 7;
const double pi = acos(-1.0);
const double eps = 0.0000000001;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <typename T>
inline void pr2(T x, int k = 64) {
  long long i;
  for (i = 0; i < k; i++) fprintf(stderr, "%d", (x >> i) & 1);
  putchar(' ');
}
template <typename T>
inline void add_(T &A, int B) {
  A += B;
  (A >= M) && (A -= M);
}
template <typename T>
inline void mul_(T &A, long long B) {
  (A *= B) %= M;
}
template <typename T>
inline void mod_(T &A, long long B = M) {
  A %= M;
}
template <typename T>
inline void max_(T &A, T B) {
  (A < B) && (A = B);
}
template <typename T>
inline void min_(T &A, T B) {
  (A > B) && (A = B);
}
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <typename T>
inline T powMM(T a, T b) {
  T ret = 1;
  for (; b; b >>= 1ll, a = (long long)a * a % M)
    if (b & 1) ret = (long long)ret * a % M;
  return ret;
}
int n, m, q;
char str[maxn];
int TaskA();
void Task_one() { TaskA(); }
void Task_T() {
  int T;
  scanf("%d", &T);
  while (T--) TaskA();
}
void Task_more_n() {
  while (~scanf("%d", &n)) TaskA();
}
void Task_more_n_m() {
  while (~scanf("%d%d", &n, &m)) TaskA();
}
void Task_more_n_m_q() {
  while (~scanf("%d%d%d", &n, &m, &q)) TaskA();
}
void Task_more_string() {
  while (~scanf("%s", str)) TaskA();
}
const int N = 87;
struct matrix {
  long long A[N][N];
  matrix() { memset(A, 0x3f, sizeof(A)); }
} base;
int id[1 << 8 | 7], rid[1 << 8 | 7], cnt = 0;
int popcnt(int x) {
  int ret = 0;
  while (x) ret += x & 1, x >>= 1;
  return ret;
}
int c[maxn];
void bfs(int x, int k) {
  int sta, i;
  base = matrix();
  for (sta = 0; sta < (1 << k); sta++)
    if (popcnt(sta) == x) id[sta] = cnt, rid[cnt++] = sta;
  for (sta = 0; sta < (1 << k); sta++)
    if (popcnt(sta) == x) {
      if (sta & 1) {
        for (i = 1; i <= k; i++)
          if (!((sta >> i) & 1)) {
            int nxtsta = (sta | (1 << i)) >> 1;
            base.A[id[sta]][id[nxtsta]] = c[i];
          }
      } else {
        int nxtsta = sta >> 1;
        base.A[id[sta]][id[nxtsta]] = 0;
      }
    }
}
matrix mul(matrix &A, matrix &B) {
  matrix C;
  int i, j, k;
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++)
      for (k = 0; k < N; k++) min_(C.A[i][j], A.A[i][k] + B.A[k][j]);
  return C;
}
matrix poww(matrix a, long long b) {
  matrix ret;
  int i;
  for (i = 0; i < N; i++) ret.A[i][i] = 0;
  for (; b; b >>= 1ll, a = mul(a, a))
    if (b & 1) ret = mul(ret, a);
  return ret;
}
pair<int, int> p[maxn];
long long now[maxn], nxt[maxn];
int TaskA() {
  int i;
  int x, k, q;
  scanf("%d%d%d%d", &x, &k, &n, &q);
  for (i = 1; i <= k; i++) scanf("%d", &c[i]);
  bfs(x, k);
  int nowpos = 1;
  for (i = 1; i <= q; i++) scanf("%d%d", &p[i].first, &p[i].second);
  sort(p + 1, p + 1 + q);
  p[++q] = make_pair(n, 0);
  for (i = 0; i < N; i++) now[i] = INFF;
  now[id[(1 << x) - 1]] = 0;
  for (i = 1; i <= q; i++) {
    int nxtpos = min(p[i].first, n - x + 1), j, k;
    matrix trans = poww(base, nxtpos - nowpos);
    nowpos = nxtpos;
    for (j = 0; j < N; j++) nxt[j] = INFF;
    for (j = 0; j < N; j++)
      for (k = 0; k < N; k++) min_(nxt[k], now[j] + trans.A[j][k]);
    for (j = 0; j < N; j++) now[j] = nxt[j];
    for (j = 0; j < N; j++)
      if (rid[j] & 1) now[j] += p[i].second;
  }
  printf("%lld\n", now[id[(1 << x) - 1]]);
  return 0;
}
void initialize() {}
int main() {
  int startTime = clock();
  initialize();
  fprintf(stderr, "/--- initializeTime: %ld milliseconds ---/\n",
          clock() - startTime);
  Task_one();
}