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 std::map;
using std::max;
using std::min;
using std::set;
using std::string;
using std::vector;
constexpr long long magic_mod = 1000000007;
constexpr long long big = 1ll << 60;
struct Matrix {
  long long size;
  vector<long long> f;
  Matrix(long long size, long long start_value = big)
      : size(size), f(size * size, start_value) {}
  Matrix(const Matrix& o) { *this = o; };
  static vector<Matrix> cache;
  inline long long& m(long long a, long long b) { return f[a * size + b]; }
  inline const long long& m(long long a, long long b) const {
    return f[a * size + b];
  }
  void print() {
    for (long long i = 0; i < size; ++i) {
      for (long long j = 0; j < size; ++j) {
        std::cout << m(j, i) << " ";
      }
      std::cout << std::endl;
    }
  }
  void operator=(const Matrix& o) {
    this->size = o.size;
    this->f = o.f;
  }
  Matrix operator*(const Matrix& o) const {
    Matrix res(size);
    for (long long i = 0; i < size; ++i) {
      for (long long j = 0; j < size; ++j) {
        for (long long k = 0; k < size; ++k) {
          res.m(i, j) = min(res.m(i, j), m(k, j) + o.m(i, k));
        }
      }
    }
    return res;
  }
  Matrix get_pow(long long p) {
    Matrix res(*this);
    bool inited = false;
    for (long long i = 1;; ++i) {
      if (!p) {
        break;
      }
      if (p % 2) {
        if (!inited) {
          res = cache[i];
          inited = true;
        } else {
          res = res * cache[i];
        }
      }
      p /= 2;
    }
    return res;
  }
  void fill_cache();
};
const long long xxxx = 40;
vector<Matrix> Matrix::cache;
void Matrix::fill_cache() {
  cache = vector<Matrix>(xxxx, Matrix(size));
  Matrix res(*this);
  for (long long i = 1; i < xxxx; ++i) {
    cache[i] = res;
    res = res * res;
  }
}
vector<long long> standings;
vector<long long> jw;
long long sn;
map<long long, long long> magic_stones;
inline long long btc(long long x) {
  long long res = 0;
  while (x) {
    if (x % 2) ++res;
    x /= 2;
  }
  return res;
}
long long get_index(long long standing) {
  for (long long i = 0; i < standings.size(); ++i) {
    if (standings[i] == standing) return i;
  }
  std::cerr << "WTF, INVALID STANDING " << standing << std::endl;
  return -1;
}
void CalcJmpMatrix(Matrix& jumpm, long long pos = -1) {
  for (long long i = 0; i < standings.size(); ++i) {
    long long ss = standings[i];
    long long smallest = 1;
    while ((ss & smallest) == 0) smallest *= 2;
    for (long long j = 0; j < jw.size(); ++j) {
      long long ns = ss;
      ns &= ~smallest;
      if (ns & (smallest << j)) continue;
      ns |= smallest << j;
      if ((ns & 1) == 0 && ns < (1 << jw.size())) {
        auto& x = jumpm.m(i, get_index(ns >> 1));
        long long aw = 0;
        if (pos >= 0 && j != 0) {
          long long pos2 = pos;
          long long sm2 = smallest >> 1;
          while (sm2) {
            ++pos2;
            sm2 /= 2;
          }
          pos2 += j;
          if (magic_stones.find(pos2) != magic_stones.end()) {
            aw = magic_stones[pos2];
          }
        }
        x = min(x, (long long)jw[j] + aw);
      }
    }
  }
}
vector<long long> mul(const vector<long long>& x, const Matrix& m) {
  vector<long long> res(sn, big);
  for (long long i = 0; i < sn; ++i) {
    for (long long j = 0; j < sn; ++j) {
      res[i] = min(res[i], x[j] + m.m(j, i));
    }
  }
  return res;
}
void print_state(long long pos, vector<long long>& res) {}
int main() {
  long long x, k, n, q;
  scanf("%lld%lld%lld%lld", &x, &k, &n, &q);
  jw = vector<long long>(k + 1, 0);
  for (long long i = 1; i <= k; ++i) scanf("%lld", &(jw[i]));
  for (long long i = 0; i < q; ++i) {
    long long p, pw;
    scanf("%lld%lld", &p, &pw);
    magic_stones[p - 1] = pw;
  }
  for (long long i = 0; i < (1 << k); ++i) {
    if (btc(i) == x) {
      standings.push_back(i);
    }
  }
  sn = standings.size();
  Matrix jumpm(sn);
  CalcJmpMatrix(jumpm);
  jumpm.fill_cache();
  vector<long long> res(sn, big);
  res[0] = 0;
  long long cp = 0;
  long long des_pos = n - x;
  print_state(cp, res);
  for (auto ms : magic_stones) {
    if (ms.first == cp) continue;
    if (ms.first - k > cp) {
      res = mul(res, jumpm.get_pow(ms.first - k - cp));
      cp = ms.first - k;
      print_state(cp, res);
    }
    for (; cp < ms.first && cp < des_pos;) {
      Matrix msm(sn);
      CalcJmpMatrix(msm, cp);
      res = mul(res, msm);
      ++cp;
      print_state(cp, res);
    }
  }
  if (cp < des_pos) {
    res = mul(res, jumpm.get_pow(des_pos - cp));
    cp = des_pos;
    print_state(cp, res);
  }
  print_state(cp, res);
  std::cout << res[0] << std::endl;
}