#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, pair<long long, long long>> a,
         pair<long long, pair<long long, long long>> b) {
  if (a.first != b.first)
    return a.first < b.first;
  else
    return a.second.first < b.second.first;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n), c(n);
  deque<pair<long long, pair<long long, long long>>> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    v[i].second.second = a[i];
    v[i].second.first = i;
  }
  for (long long i = 0; i < n; i++) {
    cin >> c[i];
    v[i].first = c[i];
  }
  sort(v.begin(), v.end(), cmp);
  long long sum = 0;
  while (m--) {
    long long t, d;
    long long ts = 0;
    cin >> t >> d;
    t--;
    if (a[t] - d >= 0) {
      ts = d * c[t];
      a[t] -= d;
    } else {
      if (a[t] > 0) {
        ts = a[t] * c[t];
        d -= a[t];
        a[t] = 0;
      }
      while (d != 0 && v.size() != 0) {
        v[0].second.second = a[v[0].second.first];
        if (v[0].second.second - d >= 0) {
          ts += d * v[0].first;
          a[v[0].second.first] -= d;
          d = 0;
        } else {
          ts += a[v[0].second.first] * v[0].first;
          d -= v[0].second.second;
          a[v[0].second.first] = 0;
          v[0].second.second = 0;
          v.pop_front();
        }
      }
      if (d > 0) ts = 0;
    }
    cout << ts << endl;
  }
  return 0;
}
