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;
using ll = long long;
vector<int> allMasks(int x, int k) {
  vector<int> ans;
  for (int i = 0; i < (1 << k); i++)
    if (__builtin_popcount(i) == x) ans.push_back(i);
  return ans;
}
struct matrix {
  vector<ll> V;
  int N;
  matrix(int N) {
    this->N = N;
    V.assign(N * N, LLONG_MAX / 2);
    for (int i = 0; i < N; i++) (*this)(i, i) = 0;
  }
  ll& operator()(int i, int j) { return V[i * N + j]; }
  ll operator()(int i, int j) const { return V[i * N + j]; }
  matrix operator*(const matrix& rhs) const {
    matrix ans(N);
    for (int i = 0; i < N; i++)
      for (int j = 0; j < N; j++) {
        ans(i, j) = LLONG_MAX / 2;
        for (int k = 0; k < N; k++)
          ans(i, j) = min(ans(i, j), (*this)(i, k) + rhs(k, j));
      }
    return ans;
  }
  matrix power(ll b) const {
    matrix ans(N);
    matrix tmp = *this;
    while (b) {
      if (b & 1) ans = ans * tmp;
      tmp = tmp * tmp;
      b >>= 1;
    }
    return ans;
  }
};
matrix build_matrix(const vector<int>& masks, const vector<int>& mask_inx,
                    const vector<ll>& cost) {
  const int N = masks.size();
  const int K = cost.size();
  matrix ans(N);
  fill(ans.V.begin(), ans.V.end(), LLONG_MAX / 2);
  for (int i = 0; i < N; i++) {
    int m = masks[i];
    if ((m & 1) == 0) {
      int i2 = mask_inx[m >> 1];
      ans(i, i2) = 0;
      continue;
    }
    for (int jump = 0; jump < K; jump++) {
      int m2 = (m >> 1) | (1 << jump);
      if (mask_inx[m2] >= 0 && mask_inx[m2] < N)
        ans(i, mask_inx[m2]) = cost[jump];
    }
  }
  return ans;
}
vector<ll> multi_step(const vector<ll>& state, const matrix& mat, ll size) {
  const int N = state.size();
  matrix tmp = mat.power(size);
  vector<ll> ans(N, LLONG_MAX / 2);
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) ans[i] = min(ans[i], state[j] + tmp(j, i));
  return ans;
}
vector<ll> advance1(const vector<ll>& state, const vector<int>& masks,
                    const vector<int>& mask_inx, const vector<ll>& cost,
                    const vector<pair<ll, ll>>& special, int pos) {
  const int N = state.size();
  const int K = cost.size();
  vector<ll> ans(N, LLONG_MAX / 2);
  for (int i = 0; i < N; i++) {
    int m = masks[i];
    if ((m & 1) == 0) {
      int i2 = mask_inx[m >> 1];
      ans[i2] = min(ans[i2], state[i]);
      continue;
    }
    for (int jump = 0; jump < K; jump++) {
      int m2 = (m >> 1) | (1 << jump);
      int i2 = mask_inx[m2];
      if (i2 < 0 || i2 >= N) continue;
      ll total_cost = cost[jump];
      int new_space = pos + jump + 1;
      for (auto& sp : special)
        if (sp.first == new_space) total_cost += sp.second;
      ans[i2] = min(ans[i2], state[i] + total_cost);
    }
  }
  return ans;
}
int main() {
  int x, k, n, q;
  scanf("%d %d %d %d", &x, &k, &n, &q);
  vector<int> masks = allMasks(x, k);
  vector<int> mask_inx(1 << k, -1);
  for (int i = 0; i < masks.size(); i++) mask_inx[masks[i]] = i;
  vector<ll> c(k);
  for (ll& x : c) scanf("%lld", &x);
  matrix M = build_matrix(masks, mask_inx, c);
  vector<pair<ll, ll>> special(q);
  for (auto& sp : special) {
    scanf("%lld %lld", &sp.first, &sp.second);
    sp.first--;
  }
  sort(special.begin(), special.end());
  vector<ll> state(masks.size(), LLONG_MAX / 2);
  state[mask_inx[(1 << x) - 1]] = 0;
  ll pos = 0;
  for (auto& sp : special) {
    const ll pos_right_before = min(sp.first - k, (ll)n - x);
    if (pos_right_before > pos) {
      state = multi_step(state, M, pos_right_before - pos);
      pos = pos_right_before;
    }
    for (int ad = 0; pos < n - x && ad < k; ad++) {
      state = advance1(state, masks, mask_inx, c, special, pos);
      pos++;
    }
  }
  if (n - x - pos > 0) state = multi_step(state, M, n - x - pos);
  printf("%lld\n", state[mask_inx[(1 << x) - 1]]);
  return 0;
}