#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[100004], c[100004];
set<pair<long long, int> > tr;
set<pair<long long, int> >::iterator it;
bool vis[100004];
int main() {
  tr.clear();
  memset(vis, 0, sizeof(vis));
  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]);
  for (int i = 1; i <= n; i++) {
    tr.insert(make_pair(c[i], i));
  }
  long long ans = 0;
  for (int i = 1; i <= m; i++) {
    ans = 0;
    int t;
    long long d;
    scanf("%d%lld", &t, &d);
    if (a[t] >= d) {
      a[t] -= d;
      ans += d * c[t];
      if (a[t] == 0) {
        if (!vis[t]) {
          tr.erase(make_pair(c[t], t));
          vis[t] = 1;
        }
      }
      printf("%lld\n", ans);
    } else {
      ans += a[t] * c[t];
      d -= a[t];
      a[t] = 0;
      if (!vis[t]) {
        tr.erase(make_pair(c[t], t));
        vis[t] = 1;
      }
      while (tr.size() > 0) {
        it = tr.begin();
        pair<long long, int> now = (*it);
        if (a[now.second] <= d) {
          ans += a[now.second] * c[now.second];
          d -= a[now.second];
          a[now.second] = 0;
          if (!vis[now.second]) {
            tr.erase(now);
            vis[now.second] = 1;
          }
        } else {
          a[now.second] -= d;
          ans += d * c[now.second];
          d = 0;
          break;
        }
      }
      if (d > 0) {
        puts("0");
        continue;
      }
      printf("%lld\n", ans);
    }
  }
  return 0;
}
