#include <bits/stdc++.h>
long long fact[200005];
long long inf = 1e18;
long long z = 1e9 + 7;
long long zz = 998244353;
long long gdp(long long a, long long b) { return (a - (a % b)); }
long long ld(long long a, long long b) {
  if (a < 0) return -1 * gdp(abs(a), b);
  if (a % b == 0) return a;
  return (a + (b - a % b));
}
long long gd(long long a, long long b) {
  if (a < 0) return (-1 * ld(abs(a), b));
  return (a - (a % b));
}
long long gcd(long long a, long long b) {
  if (b > a) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long e_gcd(long long a, long long b, long long &x, long long &y) {
  if (b > a) return e_gcd(b, a, y, x);
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  e_gcd(b, a % b, x1, y1);
  x = y1;
  y = (x1 - ((a / b) * y1));
  return e_gcd(b, a % b, x1, y1);
}
long long power(long long a, long long b, long long p) {
  if (b == 0) return 1;
  long long c = power(a, b / 2, p);
  if (b % 2 == 0)
    return ((c * c) % p);
  else
    return ((((c * c) % p) * a) % p);
}
long long inverse(long long a, long long n) { return power(a, n - 2, n); }
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long left(long long i) { return ((2 * i) + 1); }
long long right(long long i) { return ((2 * i) + 2); }
long long ncr(long long n, long long r) {
  if (n < r || (n < 0) || (r < 0)) return 0;
  return ((((fact[n] * inverse(fact[r], z)) % z) * inverse(fact[n - r], z)) %
          z);
}
void swap(char &a, char &b) {
  char c = a;
  a = b;
  b = c;
  return;
}
long double pi = acos(-1);
long long pow(long long a, long long b) {
  if (b == 0) return 1;
  long long c = pow(a, b / 2);
  if (b % 2 == 0)
    return (c * c);
  else
    return ((c * c) * a);
}
using namespace std;
struct mytype {
  bool a;
  long long b;
};
const int N = 1e3 + 7;
long long dp[N][1 << 3];
long long get_binary(string s) {
  long long k = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'A') k += 4;
    if (s[i] == 'B') k += 2;
    if (s[i] == 'C') k += 1;
  }
  return k;
}
vector<long long> fun(long long n) {
  long long k = n / 3;
  vector<long long> cnt(3, 0);
  for (long long i = 0; i < 3; i++) cnt[i] = k;
  long long r = n % 3;
  for (long long i = 1; i < r + 1; i++) cnt[i]++;
  return cnt;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  long long a[n];
  long long c[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  set<pair<long long, long long>> avail;
  for (long long i = 0; i < n; i++) cin >> c[i], avail.insert({c[i], i});
  while (m--) {
    long long k, id;
    cin >> id >> k;
    id--;
    long long cost = 0;
    if (a[id] >= k) {
      a[id] -= k;
      cost += c[id] * k;
      k = 0;
    } else if (a[id] >= 0 and a[id] < k) {
      cost += c[id] * a[id];
      k -= a[id];
      a[id] = 0;
      avail.erase({c[id], id});
      while (avail.size() != 0) {
        auto x = *avail.begin();
        if (a[x.second] > k) {
          cost += c[x.second] * k;
          a[x.second] -= k;
          k = 0;
        } else {
          cost += c[x.second] * a[x.second];
          k -= a[x.second];
          a[x.second] = 0;
          avail.erase(x);
        }
        if (k == 0) break;
      }
      if (k != 0) {
        cost = 0;
      }
    }
    cout << cost << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fact[0] = 1;
  for (long long i = 1; i < 200002; i++) {
    fact[i] = (i * fact[i - 1]) % z;
  }
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
