#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define lowbit(x) ((x)&(-(x)))
#define mid ((l+r)>>1)
#define lson rt<<1, l, mid
#define rson rt<<1|1, mid+1, r
#define fors(i, a, b) for(int i = (a); i < (b); ++i)
#define all(vec) vec.begin(),vec.end()
using namespace std;
const int maxn = 5e4 + 5;
const int M = 1e5 + 5;
int lc[M*200], rc[M*200], mi[M*200], tot = 0;
int cv(){
    tot++; lc[tot]=rc[tot]=0;mi[tot]=M;return tot;
}
void up(int rt){
    mi[rt] = min(mi[lc[rt]], mi[rc[rt]]); return;
}
void update(int &rt, int l, int r, int pos, int v){
    if(!rt) rt = cv();
    if(l==r) {
        mi[rt] = min(v, mi[rt]); return;
    }
    if(pos <= mid) update(lc[rt], l, mid, pos, v);
    else update(rc[rt], mid+1, r, pos, v);
    up(rt);
    return;
}
int qry(int rt, int l, int r, int L, int R){
    if(!rt) return M;
    if(L <= l && r <= R) return mi[rt];
    int res = M;
    if(L <= mid) res = min(res, qry(lc[rt], l, mid, L, R));
    if(R > mid) res = min(res, qry(rc[rt], mid+1, r, L, R));
    return res;
}
int n, m;
int a[M], b[M];
vector<int> h[maxn];
int ans[maxn];
int T[maxn];
void add(int l, int r, int id){
    while(r <= n) update(T[r], 1, n, l, id), r += lowbit(r);
}
int ask(int l, int r){
    int res = M;
    while(r) {
        res = min(res, qry(T[r], 1, n, l, n)), r -= lowbit(r);
    }

    return res;
}
int sol(int l, int r){
    if(l > r) return 0;
    int id = ask(l, r);
    if(id>m) return 0;
    return sol(l,a[id]-1)+sol(b[id]+1,r)+b[id]-a[id]+1;
}
int main()
{
    mi[0] = M;
    scanf("%d%d", &n, &m);
    fors(i,1,m+1){
        scanf("%d%d", &a[i], &b[i]); h[b[i]-a[i]+1].pb(i);
    }
    for(int i = n; i >= 1; --i){
        for(int id:h[i]) add(a[id], b[id], id);
        ans[i] = sol(1, n);
    }
    fors(i,1,n+1) printf("%d\n", ans[i]);
	return 0;
}
