#include <bits/stdc++.h>
using namespace std;
long long a[100001], c[100001];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  for (int i = 1; i <= n; ++i) scanf("%lld", &c[i]);
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      pq;
  for (int i = 1; i <= n; ++i) pq.push({c[i], i});
  while (m--) {
    int t;
    long long d;
    scanf("%d %lld", &t, &d);
    long long tot = 0;
    if (d <= a[t]) {
      tot += d * c[t];
      a[t] -= d;
      d = 0;
    } else {
      tot += a[t] * c[t];
      d -= a[t];
      a[t] = 0;
    }
    while (!pq.empty() && d > 0) {
      pair<long long, long long> now = pq.top();
      pq.pop();
      if (a[now.second] == 0) continue;
      if (d <= a[now.second]) {
        tot += d * c[now.second];
        a[now.second] -= d;
        d = 0;
        pq.push({c[now.second], now.second});
      } else {
        tot += a[now.second] * c[now.second];
        d -= a[now.second];
        a[now.second] = 0;
      }
    }
    printf("%lld\n", d == 0 ? tot : 0);
  }
  return 0;
}
