#include <bits/stdc++.h>
using namespace std;
inline long long GCD(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
};
inline long long LCM(long long a, long long b) { return a / GCD(a, b) * b; };
inline long long fpow(long long n, long long k, long long p) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
};
inline long long inv(long long a, long long p) { return fpow(a, p - 2, p); }
const long long MOD = (long long)1e9 + 7;
const long long MAXUS = 1e20 + 1;
const long double PI = acos((long double)-1);
const long double epsilon = 1e-9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> rem_dishes(n + 1), costs(n + 1);
  vector<pair<long long, long long>> cheapest(n);
  for (int i = 0; i < (n); i++) {
    cin >> rem_dishes[i + 1];
  }
  for (int i = 0; i < (n); i++) {
    cin >> costs[i + 1];
    cheapest[i] = {costs[i + 1], i + 1};
  }
  sort(cheapest.begin(), cheapest.end());
  vector<long long> result;
  long long cheapest_idx = 0;
  for (int i = 0; i < (m); i++) {
    long long t, d;
    cin >> t >> d;
    long long dish_no = rem_dishes[t];
    long long dish_cost = costs[t];
    long long no_diff = dish_no - d;
    long long cost = 0;
    if (no_diff >= 0) {
      cost += d * dish_cost;
      rem_dishes[t] = no_diff;
    } else {
      cost += dish_no * dish_cost;
      rem_dishes[t] = 0;
      long long rem_ordered_dish = abs(no_diff);
      while (cheapest_idx < n) {
        long long cheapest_type = cheapest[cheapest_idx].second;
        long long cheapest_rem = rem_dishes[cheapest_type];
        long long cheapest_cost = cheapest[cheapest_idx].first;
        long long diff = cheapest_rem - rem_ordered_dish;
        if (diff >= 0) {
          cost += rem_ordered_dish * cheapest_cost;
          rem_dishes[cheapest_type] = diff;
          rem_ordered_dish = 0;
          break;
        } else {
          cost += cheapest_rem * cheapest_cost;
          rem_dishes[cheapest_type] = 0;
          rem_ordered_dish -= cheapest_rem;
        }
        cheapest_idx++;
      }
      if (rem_ordered_dish > 0) {
        cost = 0;
      }
    }
    result.push_back(cost);
  }
  for (int i = 0; i < (m); i++) {
    cout << result[i] << endl;
  }
  return 0;
}
