#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define whole(v) (v).begin(),(v).end() #define rwhole(v) (v).rbegin(),(v).rend() #define press(v) (v).erase(unique(whole(v)),(v).end()) #define Yes cout<<"Yes"< #define vll vector #define vpint vector> #define vvint vector> #define vvll vector> #define pqint priority_queue #define pqpint priority_queue> #define rpqint priority_queue,greater> #define rpqpint priority_queue,vector>,greater>> using namespace std; using ll = long long; int mod107 = 1000000007, mod998 = 998244353; string alphabet = "abcdefghijklmnopqrstuvwxyz", ALFHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //(a,b)と(c,d)の距離 double pyth(ll a, ll b, ll c, ll d) { double l = sqrt((a - c) * (a - c) + (b - d) * (b - d)); return l; } //aのb乗をmで割った余り(a,bは非負整数,mは自然数) int power(ll a, ll b, int m) { int k = 0, ans = 1; vector v(100); v[0] = a; for (int i = 1; i < 100; i++) v[i] = v[i - 1] * v[i - 1] % m; while (b > 0) { if (b % 2) ans = ans * v[k] % m; k++; b /= 2; } return ans; } //素数判定 O(sqrt(n)) bool prime_judge(ll n) { for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) { return false; } } return true; } int main() { int n, m; cin >> n >> m; vint l(m), r(m), ans(n + 2); for (int i = 0; i < m; i++) { cin >> l[i] >> r[i]; ans[l[i]]++; ans[r[i] - 1]--; } for (int i = n; i > 0; i--) { ans[i] += ans[i + 1]; cout << ans[i] << endl; } cout << endl; }