#include <bits/stdc++.h>

using namespace std;

// こういうのは平方分割なんですよね　初見さん

#define int long long

signed main() {
  int N, M;
  scanf("%lld %lld", &N, &M);
  int ukunichia_chan[101][101] = {{}};
  int beet_ikiruna[100001] = {}, beet_sz = 0, add = 0;
  for(int i = 0; i < M; i++) {
    int a, b;
    scanf("%lld %lld", &a, &b);
    if(b < 101) {
      ukunichia_chan[a][b]++;
    } else {
      // 1個ずつ増える項
      add += a + 1;
      beet_sz++;
      int ret = 0;
      for(int j = b - a - 1; j < N; j += b) {
        ++ret;
        beet_ikiruna[j] += b;
      }
    }
  }

  int X[100000] = {};
  int cost = 0;
  for(int i = 0; i < N; i++) {
    add -= beet_ikiruna[i];
    X[i] += cost;
    X[i] += add;
    cost += beet_sz;
  }

  for(int i = 0; i <= 100; i++) {
    for(int j = i + 1; j <= 100; j++) {
      int latte = i + 1;
      if(ukunichia_chan[i][j] == 0) continue;
      if(latte == j) latte -= j;
      for(int k = 0; k < N; k++) {
        X[k] += latte * ukunichia_chan[i][j];
        latte++;
        if(latte == j) latte -= j;
      }
    }
  }


  for(int i = 0; i < N; i++) printf("%lld\n", X[i]);
}


