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>
#pragma GCC optimize("Ofast")
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
using ll = long long;
using ld = long double;
constexpr int nax = 150;
constexpr int mod = 1000 * 1000 * 1000 + 7;
constexpr ll infty = numeric_limits<ll>::max();
int x, k;
int size;
int M;
unordered_map<int, int> rev_maski;
vector<int> maski;
ll c[nax];
int Rev(int maska) {
  auto it = rev_maski.find(maska);
  assert(it != rev_maski.end());
  return it->second;
}
struct Mac {
  ll m[nax][nax];
  void Id() {
    for (int i = 0; i < M; i++) {
      for (int j = 0; j < M; j++) {
        m[i][j] = infty;
      }
      m[i][i] = 0;
    }
  }
  void Init(const vector<ll>& wi) {
    for (int i = 0; i < M; i++) {
      for (int j = 0; j < M; j++) {
        m[i][j] = infty;
      }
    }
    assert((int)wi.size() == size);
    for (int i = 0; i < M; i++) {
      const int maska = maski[i];
      if (maska % 2 == 0) {
        m[i][Rev(maska >> 1)] = 0;
      } else {
        for (int j = 1; j <= k; j++) {
          if ((maska >> j) & 1) {
          } else {
            m[i][Rev((maska | (1 << j)) >> 1)] = c[j] + wi[j];
          }
        }
      }
    }
  }
  void Mnoz(const Mac& a, const Mac& b) {
    for (int i = 0; i < M; i++) {
      for (int j = 0; j < M; j++) {
        m[i][j] = infty;
      }
    }
    for (int i = 0; i < M; i++) {
      for (int j = 0; j < M; j++) {
        for (int l = 0; l < M; l++) {
          if (a.m[i][j] != infty and b.m[j][l] != infty) {
            m[i][l] = min(m[i][l], a.m[i][j] + b.m[j][l]);
          }
        }
      }
    }
  }
  vector<ll> Wektor(const vector<ll>& v) const {
    vector<ll> result(M, infty);
    for (int i = 0; i < M; i++) {
      for (int j = 0; j < M; j++) {
        if (m[i][j] != infty and v[i] != infty) {
          result[j] = min(result[j], v[i] + m[i][j]);
        }
      }
    }
    debug() << "Wektor("
               " ["
            << "v"
               ": "
            << (v)
            << "] "
               " ["
            << "result"
               ": "
            << (result)
            << "] "
               ")";
    return result;
  }
};
debug& operator<<(debug& deb, const Mac& m) { return deb; }
constexpr int MaxPot = 30;
Mac potegi[MaxPot];
vector<ll> Domnoz(vector<ll> v, int pot) {
  for (int i = 0; i < MaxPot; i++) {
    if ((pot >> i) & 1) {
      debug() << " ["
              << "i"
                 ": "
              << (i) << "] ";
      v = potegi[i].Wektor(v);
    }
  }
  return v;
}
int n, q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> x >> k >> n >> q;
  debug() << " ["
          << "x"
             ": "
          << (x)
          << "] "
             " ["
          << "k"
             ": "
          << (k)
          << "] "
             " ["
          << "n"
             ": "
          << (n)
          << "] "
             " ["
          << "q"
             ": "
          << (q) << "] ";
  size = k + 1;
  for (int i = 0; i < (1 << size); i++) {
    if (__builtin_popcount(i) == x) {
      maski.push_back(i);
    }
  }
  for (int i = 0; i < (int)maski.size(); i++) {
    rev_maski[maski[i]] = i;
  }
  M = (int)maski.size();
  debug() << " ["
          << "maski.size()"
             ": "
          << (maski.size()) << "] ";
  assert((int)maski.size() < nax);
  for (int i = 1; i <= k; i++) {
    cin >> c[i];
  }
  vector<int> intr;
  map<int, ll> ws;
  while (q--) {
    int p;
    ll wp;
    cin >> p >> wp;
    p--;
    ws[p] = wp;
    for (int i = -k; i <= k; i++) {
      int y = p + i;
      if (0 <= y and y <= n - x) {
        intr.push_back(y);
      }
    }
  }
  intr.push_back(n - x);
  sort(intr.begin(), intr.end());
  intr.resize(unique(intr.begin(), intr.end()) - intr.begin());
  debug() << " ["
          << "ws"
             ": "
          << (ws) << "] ";
  debug() << " ["
          << "intr"
             ": "
          << (intr) << "] ";
  potegi[0].Init(vector<ll>(size, 0));
  for (int i = 1; i < MaxPot; i++) {
    potegi[i].Mnoz(potegi[i - 1], potegi[i - 1]);
  }
  debug() << " ["
          << "maski"
             ": "
          << (maski) << "] ";
  debug() << " ["
          << "potegi[0]"
             ": "
          << (potegi[0]) << "] ";
  debug() << " ["
          << "potegi[1]"
             ": "
          << (potegi[1]) << "] ";
  debug() << " ["
          << "potegi[2]"
             ": "
          << (potegi[2]) << "] ";
  vector<ll> oks(M, infty);
  for (int i = 0; i < M; i++) {
    if (maski[i] == ((1 << x) - 1)) {
      assert(i == 0);
      oks[i] = 0;
    }
  }
  int nast = 0;
  for (int y : intr) {
    debug() << " ["
            << "y"
               ": "
            << (y)
            << "] "
               " ["
            << "oks"
               ": "
            << (oks) << "] ";
    assert(nast <= y);
    if (nast < y) {
      oks = Domnoz(oks, y - nast);
      debug() << "Domnoz("
                 " ["
              << "y - nast"
                 ": "
              << (y - nast)
              << "] "
                 ")"
                 " ["
              << "oks"
                 ": "
              << (oks) << "] ";
    }
    if (y == n - x) {
      break;
    }
    Mac m;
    vector<ll> w;
    for (int i = 0; i < size; i++) {
      w.push_back(ws[y + i]);
    }
    m.Init(w);
    debug() << " ["
            << "w"
               ": "
            << (w)
            << "] "
               " ["
            << "m"
               ": "
            << (m) << "] ";
    oks = m.Wektor(oks);
    debug() << " ["
            << "oks"
               ": "
            << (oks) << "] ";
    nast = y + 1;
  }
  debug() << " ["
          << "oks"
             ": "
          << (oks) << "] ";
  for (int i = 0; i < M; i++) {
    if (maski[i] == (((1 << x) - 1))) {
      cout << oks[i] << endl;
      return 0;
    }
  }
  assert(false);
  return 0;
}