#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

#define SQ 4

ll N,M;
ll A[100010],B[100010];
ll X[100110];
ll add[SQ][100010];

int main(){
  cin>>N>>M;
  rep(i,M){
    cin>>A[i]>>B[i];
  }
  rep(i,M){
    if(B[i]>=SQ){
      ll s=B[i]-A[i];
      for(;s<=N;s+=B[i]){
        X[min(s+1,N+5)]+=1;
        X[min(s+B[i],N+5)]-=B[i];
        X[min(s+B[i]+1,N+5)]+=B[i]-1;
      }
      s=B[i]-A[i];
      if(B[i]-A[i]!=1){
        ll t=(A[i]+1)%B[i];
        X[1]+=t;
        X[2]-=t-1;
        X[min(s,N+5)]-=B[i];
        X[min(s+1,N+5)]+=B[i]-1;
      }
    }else if(B[i]<SQ){
      for(ll j=1;j<=B[i];j++){
        add[B[i]][j%B[i]]+=(A[i]+j)%B[i];
      }
    }
  }
  rep(i,N+3)X[i+1]+=X[i];
  rep(i,N+3)X[i+1]+=X[i];
  repl(i,1,N+1){
    repl(k,1,SQ)X[i]+=add[k][i%k];
  }
  repl(i,1,N+1)cout<<X[i]<<endl;

  return 0;
}

