#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#pragma warning(disable : 4996)
class LazySegmentTree {
private:
int size_;
vector<long long> v, lazy;
void update(int a, int b, long long x, int k, int l, int r) {
push(k, l, r);
if (r <= a || b <= l) return;
if (a <= l && r <= b) {
lazy[k] = x;
push(k, l, r);
}
else {
update(a, b, x, k * 2, l, (l + r) >> 1);
update(a, b, x, k * 2 + 1, (l + r) >> 1, r);
v[k] = merge(v[k * 2], v[k * 2 + 1]);
}
}
long long query(int a, int b, int k, int l, int r) {
push(k, l, r);
if (r <= a || b <= l) return 0;
if (a <= l && r <= b) return v[k];
long long lc = query(a, b, k * 2, l, (l + r) >> 1);
long long rc = query(a, b, k * 2 + 1, (l + r) >> 1, r);
return merge(lc, rc);
}
public:
LazySegmentTree() : v(vector<long long>()), lazy(vector<long long>()) {};
LazySegmentTree(int n) {
for (size_ = 1; size_ < n;) size_ <<= 1;
v.resize(size_ * 2);
lazy.resize(size_ * 2);
}
inline void push(int k, int l, int r) {
if (lazy[k] != 0) {
v[k] = lazy[k] * (r - l);
if (r - l > 1) {
lazy[k * 2] = lazy[k];
lazy[k * 2 + 1] = lazy[k];
}
lazy[k] = 0;
}
}
inline long long merge(long long x, long long y) {
return x + y;
}
inline void update(int l, int r, long long x) {
update(l, r, x, 1, 0, size_);
}
inline long long query(int l, int r) {
return query(l, r, 1, 0, size_);
}
};
int N, Q, a; long long b; LazySegmentTree seg;
inline long long solve(int p) {
long long x = (a - p) * seg.query(p, p + 1);
long long y = seg.query(p, a);
return x - y;
}
int main() {
cin >> N >> Q;
seg = LazySegmentTree(N);
while (Q--) {
cin >> a >> b;
int l = 0, r = a;
while (r - l > 1) {
int m = (l + r) >> 1;
if (solve(m) > b) l = m;
else r = m;
}
if (solve(l) > b) l++;
long long v = seg.query(l, a) + b;
seg.update(l, l + v % (a - l), v / (a - l) + 1);
seg.update(l + v % (a - l), a, v / (a - l));
//for (int i = 0; i < N; i++) cout << seg.query(i, i + 1) << ' ';
//cout <<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