#include <bits/stdc++.h>
using namespace std;
int main() {
  long long s = 0;
  long long n, a[100005], b[100000], m, c[100005], d, t;
  long long h = 0;
  cin >> n >> m;
  vector<pair<long long, long long> > vec;
  long long ma = 10000000;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    vec.push_back(make_pair(c[i], i));
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < m; i++) {
    long long k = 0;
    long long cost = 0, cost1 = 0;
    cin >> t >> d;
    t = t - 1;
    if (a[t] != 0) {
      if (a[t] - d >= 0) {
        a[t] = a[t] - d;
        cost = d * c[t];
        d = 0;
        cout << cost << "\n";
        k = -1;
      } else {
        cost = a[t] * c[t];
        d = d - a[t];
        a[t] = 0;
        for (int j = h; j < n; j++) {
          if (d <= a[vec[j].second]) {
            a[vec[j].second] = a[vec[j].second] - d;
            cost1 = cost1 + (vec[j].first) * d;
            d = 0;
          } else {
            d = d - a[vec[j].second];
            cost1 = cost1 + vec[j].first * a[vec[j].second];
            a[vec[j].second] = 0;
          }
          if (d == 0) {
            h = j;
            cost = cost + cost1;
            cout << cost << "\n";
            k = -1;
            break;
          }
        }
      }
    } else {
      for (int j = h; j < n; j++) {
        if (a[vec[j].second] != 0) {
          if (d <= a[vec[j].second]) {
            a[vec[j].second] = a[vec[j].second] - d;
            cost1 = cost1 + vec[j].first * d;
            d = 0;
          } else {
            d = d - a[vec[j].second];
            cost1 = cost1 + (vec[j].first) * (a[vec[j].second]);
            a[vec[j].second] = 0;
          }
          if (d == 0) {
            cost = cost + cost1;
            k = -1;
            h = j;
            cout << cost << "\n";
            break;
          }
        }
      }
    }
    if (k == 0) cout << 0 << "\n";
  }
  return 0;
}
