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;
using PII = pair<int, int>;
template <typename T, typename Add = std::plus<T>,
          typename Mul = std::multiplies<T>>
struct Matrix {
  std::vector<std::vector<T>> D;
  Matrix(size_t m, size_t n) {
    D.resize(m);
    for (size_t i = 0; i < m; ++i) {
      D[i].resize(n);
    }
  }
  size_t m() const { return D.size(); }
  size_t n() const { return m() == 0 ? 0 : D[0].size(); }
  std::vector<T>& operator[](int i) { return D[i]; }
  Matrix<T, Add, Mul> operator*(const Matrix<T, Add, Mul>& that) const {
    assert(n() == that.m());
    Matrix<T, Add, Mul> r(m(), that.n());
    for (size_t i = 0; i < m(); ++i) {
      for (size_t j = 0; j < that.n(); ++j) {
        for (size_t k = 0; k < n(); ++k) {
          T tmp = Mul()(D[i][k], that.D[k][j]);
          r[i][j] = k == 0 ? tmp : Add()(r[i][j], tmp);
        }
      }
    }
    return std::move(r);
  }
  Matrix<T, Add, Mul> operator^(int k) const {
    assert(k >= 0);
    assert(m() == n());
    Matrix<T, Add, Mul> r(m(), m());
    bool initial = true;
    auto t = *this;
    while (k) {
      if (k & 1) {
        r = initial ? t : r * t;
        initial = false;
      }
      t = t * t;
      k >>= 1;
    }
    return std::move(r);
  }
  void print() const {
    for (size_t i = 0; i < m(); ++i) {
      for (size_t j = 0; j < n(); ++j) {
        std::cout << D[i][j] << ' ';
      }
      std::cout << std::endl;
    }
  }
};
const LL INF = 1LL << 61;
LL calcJumpCost(const bitset<10>& from, const bitset<10>& to, int Cost[]) {
  assert(from.count() == to.count());
  auto shift = to << 1;
  auto tmp = from ^ shift;
  if (tmp.count() == 0)
    return 0;
  else if (tmp.count() != 2)
    return INF;
  else {
    int p = 0;
    while (!from.test(p)) p++;
    if (!tmp.test(p)) return INF;
    tmp.reset(p);
    int q = 0;
    while (!tmp.test(q)) q++;
    if (q < p) return INF;
    return Cost[q - p];
  }
}
template <typename T>
struct Min {
  T operator()(T a, T b) { return min({a, b, INF}); }
};
Matrix<LL, Min<LL>, plus<LL>> buildMatrix(const vector<bitset<10>>& V,
                                          int C[]) {
  Matrix<LL, Min<LL>, plus<LL>> R(V.size(), V.size());
  for (size_t i = 0; i < V.size(); i++) {
    for (size_t j = 0; j < V.size(); j++) {
      auto from = V[i];
      auto to = V[j];
      R[i][j] = calcJumpCost(from, to, C);
    }
  }
  return R;
}
int x, k, n, q;
int C[10];
map<int, int> Special;
int main() {
  scanf("%d%d%d%d", &x, &k, &n, &q);
  vector<bitset<10>> V;
  for (int state = 1; state < (1 << k); state++) {
    auto bs = bitset<10>(state);
    if (int(bs.count()) != x) continue;
    V.push_back(bs);
  }
  for (int i = (1); i <= (k); ++i) scanf("%d", &C[i]);
  LL ans = 0;
  set<int> S;
  for (int i = (1); i <= (q); ++i) {
    int p, w;
    scanf("%d%d", &p, &w);
    if (p >= n - x + 1) {
      ans += w;
      continue;
    }
    for (int j = p - k; j <= p; j++) {
      if (j <= 1) continue;
      S.insert(j);
    }
    Special[p] = w;
  }
  S.insert(n - x + 1);
  auto Mul = buildMatrix(V, C);
  auto A = Mul;
  A.D.resize(1);
  for (size_t i = 0; i < A.n(); ++i) A[0][i] = INF;
  A[0][0] = 0;
  int pre = 1;
  for (auto cur : S) {
    if (cur == pre + 1) {
      auto B = A;
      for (int j = 0; j < int(V.size()); j++) {
        B[0][j] = INF;
        for (int i = 0; i < int(V.size()); i++) {
          LL update = A[0][i];
          auto from = V[i];
          auto to = V[j];
          update += calcJumpCost(from, to, C);
          auto tmp = (from ^ (to << 1)) & (~from);
          for (int k = 0; k < 10; k++) {
            if (tmp.test(k) && Special.find(k + pre) != Special.end()) {
              update += Special[k + pre];
              break;
            }
          }
          B[0][j] = min(B[0][j], update);
        }
      }
      A = B;
    } else {
      A = A * (Mul ^ (cur - pre));
    }
    pre = cur;
  }
  cout << A[0][0] + ans << endl;
  return 0;
}