#pragma region watasou /* .   ∧_∧ がばっ     寝る!    ( ・ω・)    _| ⊃/(___  <⌒/ヽ-、___ / └-(____/ /<_/____/  ̄ ̄ ̄ ̄ ̄ ̄ ̄ the pen is mightier than the sword. -エドワード・ブルワー=リットン- KCLC44TH watasou1543 ver.2.0. */ #include using namespace std; //マクロ宣言 #define rep(i, a, b) for (int i = a; i < b; i++) using ll = long long; using ld = long double; using pii = pair; using pli = pair; using pll = pair; using Graph = vector>; using V = vector; using I = int; ll mod=998244353; string Y = "Yes"; string N = "No"; #define gcd __gcd #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fi first #define se second #define fix(n) fixed << setprecision(n) #define print(n) cout << n << endl #define input(n) cin >> n //関数宣言 template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } ll jou(ll N,ll k){ ll i=0; ll p=N; ll Ans=0; while(k>=(1< seen; void dfs(const Graph &G, int v) { seen[v] = true; // v を訪問済にする // v から行ける各頂点 next_v について for (auto next_v : G[v]) { if (seen[next_v]) continue; // next_v が探索済だったらスルー dfs(G, next_v); // 再帰的に探索 } } vector > pri(long long N) { vector > res; for (long long a = 2; a * a <= N; ++a) { if (N % a != 0) continue; long long ex = 0; // 指数 // 割れる限り割り続ける while (N % a == 0) { ++ex; N /= a; } // その結果を push res.push_back({a, ex}); } // 最後に残った数について if (N != 1) res.push_back({N, 1}); return res; } //------------------------------------------------------------------------- #pragma endregion watasou int main(){ int n,m; cin >> n >> m; V l(m),r(m); rep(i,0,m){ cin >> l[i] >> r[i]; } mapmp; V imos(n,0); rep(i,0,m){ mp[l[i]]--; mp[r[i]-1]++; } imos[0]=mp[0]; rep(i,1,n){ imos[i]=imos[i-1]+mp[i]; } reverse(all(imos)); rep(i,0,n){ cout << imos[i] << endl; } }