stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <iomanip>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <math.h>

#include <vector>

#include <string>

#include <queue>

#include <deque>

#include <list>

#include <set>

#include <unordered_set>

#include <map>

#include <unordered_map>

#include <bitset>

#include <random>

#include <complex>

#include <assert.h>



using namespace std;

typedef long long ll;



constexpr ll mod = 1000000007;

constexpr ll v[] = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098 };



int main() {

	int N, T; scanf("%d", &T);

	for (int _t = 0; _t < T; _t++) {

		scanf("%d", &N);

		ll ans = 869418286;

		if (N & 1) {// odd

			for (int i = 14, j = 29; i >= 0; i--, j--) {

				ans = (ans * N + v[j]) % mod;

			}

		}

		else {// even

			for (int i = 14; i >= 0; i--) {

				ans = (ans * N + v[i]) % mod;

			}

		}

		printf("%d\n", ans);

	}



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.085937202445117x):
#include <stdio.h>



typedef long long ll;



/////////////         modの計算

constexpr ll mod = 1000000007;

constexpr ll M = mod * mod;



constexpr int K = 16;



constexpr ll v_e[] = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };

constexpr ll v_o[] = { 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };



int main() {

	int T; scanf("%d", &T);

	for (int _t = 0; _t < T; _t++) {

		ll N; scanf("%lld", &N);

		ll ans = 0, x = 1;



		if (N & 1) {// odd

			for (int i = 0; i < K; i++) {

				ans += x * v_o[i];

				x *= N;

				if (ans >= M) { ans -= M; }

				if (x >= mod) { x %= mod; }

			}

		}

		else {// even

			for (int i = 0; i < K; i++) {

				ans += x * v_e[i];

				x *= N;

				if (ans >= M) { ans -= M; }

				if (x >= mod) { x %= mod; }

			}

		}

		printf("%lld\n", ans % mod);

	}



	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <iomanip>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <math.h>

#include <vector>

#include <string>

#include <queue>

#include <deque>

#include <list>

#include <set>

#include <unordered_set>

#include <map>

#include <unordered_map>

#include <bitset>

#include <random>

#include <complex>

#include <assert.h>



using namespace std;

typedef long long ll;

#define endl '\n'



const ll mod = 1000000007LL;



int main() {

	ios::sync_with_stdio(false);

	std::cin.tie(0);



	constexpr int K = 16;



	constexpr ll v_e[] = { 869418286, 727008098, 660103155, 183023413, 471090892, 417297686, 237315285, 542573865, 444014759, 927321758, 184117322, 5655049, 347662323, 346175634, 765144583, 0};

	constexpr ll v_o[] = { 869418286, 727008098, 660103155, 183023413, 471090892, 417297686, 237315285, 542573865, 444014759, 927321758, 184117322, 962779130, 404391958, 700407153, 729548371, 539588932 };



	ll T, N; cin >> T;

	for (int _t = 0; _t < T; _t++) {

		cin >> N;

		ll ans = v_e[0];

		if (N & 1) {// odd

			for (int i = 1; i < K; i++) {

				ans *= N;

				ans += v_o[i];

				ans %= mod;

			}

		}

		else {// even

			for (int i = 1; i < K; i++) {

				ans *= N;

				ans += v_e[i];

				ans %= mod;

			}

		}

		cout << ans << endl;

	}



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.208304257447016x):
#include <stdio.h>



typedef long long ll;



/////////////         modの計算

constexpr ll mod = 1000000007;

constexpr ll M = mod * mod;



constexpr int K = 16;



constexpr ll v_e[] = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };

constexpr ll v_o[] = { 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };



int main() {

	int T; scanf("%d", &T);

	for (int _t = 0; _t < T; _t++) {

		ll N; scanf("%lld", &N);

		ll ans = 0, x = 1;



		if (N & 1) {// odd

			for (int i = 0; i < K; i++) {

				ans += x * v_o[i];

				x *= N;

				if (ans >= M) { ans -= M; }

				if (x >= mod) { x %= mod; }

			}

		}

		else {// even

			for (int i = 0; i < K; i++) {

				ans += x * v_e[i];

				x *= N;

				if (ans >= M) { ans -= M; }

				if (x >= mod) { x %= mod; }

			}

		}

		printf("%lld\n", ans % mod);

	}



	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <iomanip>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <math.h>

#include <vector>

#include <string>

#include <queue>

#include <deque>

#include <list>

#include <set>

#include <unordered_set>

#include <map>

#include <unordered_map>

#include <bitset>

#include <random>

#include <complex>

#include <assert.h>



using namespace std;

typedef long long ll;

#define endl '\n'



const ll mod = 1000000007LL;



int main() {

	ios::sync_with_stdio(false);

	std::cin.tie(0);



	constexpr int K = 16;



	constexpr ll v_e[] = { 869418286, 727008098, 660103155, 183023413, 471090892, 417297686, 237315285, 542573865, 444014759, 927321758, 184117322, 5655049, 347662323, 346175634, 765144583, 0};

	constexpr ll v_o[] = { 869418286, 727008098, 660103155, 183023413, 471090892, 417297686, 237315285, 542573865, 444014759, 927321758, 184117322, 962779130, 404391958, 700407153, 729548371, 539588932 };



	ll T, N; cin >> T;

	for (int _t = 0; _t < T; _t++) {

		cin >> N;

		ll ans = v_e[0];

		if (N & 1) {// odd

			for (int i = 1; i < K; i++) {

				ans = ans * N + v_o[i];

				if(ans >= mod) ans %= mod;

			}

		}

		else {// even

			for (int i = 1; i < K; i++) {

				ans = ans * N + v_e[i];

				if (ans >= mod) ans %= mod;

			}

		}

		cout << ans << endl;

	}



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.209233991697648x):
#include <stdio.h>



typedef long long ll;



/////////////         modの計算

constexpr ll mod = 1000000007;

constexpr ll M = mod * mod;



constexpr int K = 16;



constexpr ll v_e[] = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };

constexpr ll v_o[] = { 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };



int main() {

	int T; scanf("%d", &T);

	for (int _t = 0; _t < T; _t++) {

		ll N; scanf("%lld", &N);

		ll ans = 0, x = 1;



		if (N & 1) {// odd

			for (int i = 0; i < K; i++) {

				ans += x * v_o[i];

				x *= N;

				if (ans >= M) { ans -= M; }

				if (x >= mod) { x %= mod; }

			}

		}

		else {// even

			for (int i = 0; i < K; i++) {

				ans += x * v_e[i];

				x *= N;

				if (ans >= M) { ans -= M; }

				if (x >= mod) { x %= mod; }

			}

		}

		printf("%lld\n", ans % mod);

	}



	return 0;

}
// Slower C++ solution:
//

//	Created by shamim_nik

//



#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

typedef tree<int,null_type,less<int>,rb_tree_tag,

		tree_order_statistics_node_update> indexed_set;



#define br printf("\n")

#define pi acos(-1)



int main () {

	ios::sync_with_stdio(0);

	cin.tie(0);



//	freopen("input.txt", "r", stdin);

//	freopen("output.txt", "w", stdout);



	int N;

	cin >> N;

	int ans = N;

	while(ans % 360 != 0){

		ans += N;

	}

	cout << ans / N << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.308131684856651x):
#include<stdio.h>

#include<stdlib.h>



int main()

{



    int a,  i, n;



    scanf("%d", &a);

    i=1;

    while((360*i)%a!=0)

    {

        i++;

    }

    n = (360*(i))/(a*1.0);

    printf("%d", n);



    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<cmath>

#include<iostream>

#include<algorithm>

using namespace std;

int x;

int main()

{

	cin>>x;

	for (int i=1;i<=10000;++i)

	{

		if ((x*i)%360==0)

		{

			cout<<i<<"\n";

			return 0;

		}

	}

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.240677287373779x):
#include<stdio.h>

#include<stdlib.h>



int main()

{



    int a,  i, n;



    scanf("%d", &a);

    i=1;

    while((360*i)%a!=0)

    {

        i++;

    }

    n = (360*(i))/(a*1.0);

    printf("%d", n);



    return 0;

}
// Slower C++ solution:
#include "bits/stdc++.h"

using namespace std;



const int N=2e5+20,MOD=1e9+7;



int n,zero;

long long a,b,p[N],ans=1;

map <pair <long long,long long>,int> negative,positive;



int get(long long a,long long b)

{

	a*=-1;

	if(positive.find({b,a})==positive.end()) return 0;



	long long ans=positive[{b,a}];

	positive.erase({b,a});

	return ans;

}



int main()

{

	p[0]=1;

	for(int i=1;i<N;i++) p[i]=(p[i-1]*2)%MOD;



	scanf("%d",&n);

	while(n--)

	{

		scanf("%lld%lld",&a,&b);



		if(a==0 and b==0)

		{

			zero++;

			continue;

		}



		long long g=__gcd(a,b);

		a/=g,b/=g;

		if(b<0) a*=-1,b*=-1;

		if(a<=0) negative[{a,b}]++;

		else positive[{a,b}]++;

	}



	for(auto i:negative)

	{

		a=i.first.first,b=i.first.second;

		ans*=(p[i.second]+p[get(a,b)]-1ll)%MOD;

		ans%=MOD;

	}



	for(auto i:positive)

	{

		a=i.first.first,b=i.first.second;

		ans*=p[i.second];

		ans%=MOD;

	}



	ans=(ans+zero-1)%MOD;

	if(ans<0) ans+=MOD;

	printf("%lld",ans);

}

// Faster C++ solution for the same problem (measured speedup: 1.4267606830962019x):
#include "bits/stdc++.h"

using namespace std;



const int N=2e5+20,MOD=1e9+7;



int n,zero,p[N];

long long a,b,ans=1;

map <pair <long long,long long>,pair <int,int>> m;



int main()

{

	p[0]=1;

	for(int i=1;i<N;i++) p[i]=(p[i-1]*2)%MOD;



	scanf("%d",&n);

	while(n--)

	{

		scanf("%lld%lld",&a,&b);



		if(a==0 and b==0)

		{

			zero++;

			continue;

		}



		long long g=__gcd(a,b);

		a/=g,b/=g;

		if(b<0) a*=-1,b*=-1;

		if(a<=0) m[{b,-a}].second++;

		else m[{a,b}].first++;

	}



	for(auto i:m)

	{

		auto pr=i.second;

		ans*=(p[pr.first]+p[pr.second]-1ll)%MOD;

		ans%=MOD;

	}



	ans=(ans+zero-1)%MOD;

	if(ans<0) ans+=MOD;

	printf("%lld",ans);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N=2e5+10;

vector<pair<int,int> >v;

int ans[N],a[N];

int main()

{

    int n,m,i;

    cin>>n>>m;

    for(i=1;i<=n;i++)ans[i]=1;

    for(i=0;i<m;i++)

    {

        int x,y;

        scanf("%d%d",&x,&y);

        v.push_back(make_pair(x,y));

    }

    sort(v.begin(),v.end());

    memset(a,0,sizeof a);

    for(auto x:v)

    {

        int y=x.second;

        ans[y]=ans[y+1]=ans[y]+ans[y+1]-a[y];

        a[y]=ans[y];

    }

    cout<<ans[1];

    for(i=2;i<=n;i++)printf(" %d",ans[i]);

    cout<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8308410446286176x):
#include<bits/stdc++.h>

using namespace std;

pair<int, int>l[100009], q[200009];

bool cmp(pair<int, int>&a, pair<int, int>&b) { return a.first < b.first; }

int main()

{

	int n, m; scanf("%d%d", &n, &m);

	for (int i = 1; i <= m; i++) scanf("%d%d", &l[i].first, &l[i].second);

	for (int i = 1; i <= n; i++)q[i].first = q[i].second = i;

	sort(l + 1, l + m + 1, cmp);

	for (int i = 1; i <= m; i++) {

		int k = l[i].second;

		q[k].first = q[k + 1].first = min(q[k].first, q[k + 1].first);

		q[k].second = q[k + 1].second = max(q[k].second, q[k + 1].second);

	}

	for (int i = 1; i <= n; i++)printf("%d%c", q[i].second - q[i].first + 1, i == n ? '\n' : ' ');

}
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<algorithm>

#include<cstring>

using namespace std;

struct robot

{

	int x,y; 

}r[200005];

int left1[200005];

int right1[200005];

int res[200005];

int cmp(struct robot a,struct robot b)

{

	return a.x<b.x;

}

int main(void)

{

	int n;

	int m;

	while(~scanf("%d %d",&n,&m))

	{

		for(int i=0;i<=n;i++)

		{

			left1[i]=right1[i]=i;

		}

		memset(res,0,sizeof(res));

		for(int i=1;i<=m;i++)

		{

			scanf("%d %d",&r[i].x,&r[i].y);

		}

		sort(r+1,r+m+1,cmp);

		for(int i=1;i<=m;i++)

		{

			int xx=r[i].y;

			left1[xx]=left1[xx+1]=min(left1[xx],left1[xx+1]);

			right1[xx]=right1[xx+1]=max(right1[xx],right1[xx+1]);

		}

		cout<<right1[1]-left1[1]+1;

		for(int i=2;i<=n;i++)

		{

			cout<<" "<<right1[i]-left1[i]+1;

		}

		cout<<endl;

		

		

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.9081092676388869x):
#include<bits/stdc++.h>

using namespace std;

pair<int, int>l[100009], q[200009];

bool cmp(pair<int, int>&a, pair<int, int>&b) { return a.first < b.first; }

int main()

{

	int n, m; scanf("%d%d", &n, &m);

	for (int i = 1; i <= m; i++) scanf("%d%d", &l[i].first, &l[i].second);

	for (int i = 1; i <= n; i++)q[i].first = q[i].second = i;

	sort(l + 1, l + m + 1, cmp);

	for (int i = 1; i <= m; i++) {

		int k = l[i].second;

		q[k].first = q[k + 1].first = min(q[k].first, q[k + 1].first);

		q[k].second = q[k + 1].second = max(q[k].second, q[k + 1].second);

	}

	for (int i = 1; i <= n; i++)printf("%d%c", q[i].second - q[i].first + 1, i == n ? '\n' : ' ');

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N=2e5+10;

vector<pair<int,int> >v;

int ans[N],a[N];

int main()

{

    int n,m,i;

    cin>>n>>m;

    for(i=1;i<=n;i++)ans[i]=1;

    for(i=0;i<m;i++)

    {

        int x,y;

        scanf("%d%d",&x,&y);

        v.push_back(make_pair(x,y));

    }

    sort(v.begin(),v.end());

    memset(a,0,sizeof a);

    for(auto x:v)

    {

        int y=x.second;

        ans[y]=ans[y+1]=ans[y]+ans[y+1]-a[y];

        a[y]=ans[y];

    }

    cout<<ans[1];

    for(i=2;i<=n;i++)printf(" %d",ans[i]);

    cout<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8320105719826336x):
#include <bits/stdc++.h>

#define MAXN 200005

#define MAXM 100005

#define from first

#define to second

using namespace std;

struct arm

{

    int x,y;

    bool operator< (const arm &b) const

    {

        return x<b.x;

    }

}arms[MAXM];

int n,m;

pair<int,int> ans[MAXN];



int main()

{

    scanf("%d%d",&n,&m);

    for(int i=0;i<m;++i)

        scanf("%d%d",&(arms[i].x),&(arms[i].y));

    for(int i=1;i<=n;++i)

        ans[i].from=ans[i].to=i;

    sort(arms,arms+m);

    for(int i=0;i<m;++i)

    {

        int y=arms[i].y;

        ans[y].from=ans[y+1].from=min(ans[y].from,ans[y+1].from);

        ans[y].to=ans[y+1].to=max(ans[y].to,ans[y+1].to);

    }

    for(int i=1;i<=n;++i)

    {

        if(i>1)

            printf(" ");

        printf("%d",ans[i].to-ans[i].from+1);

    }

    printf("\n");

}
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<algorithm>

#include<cstring>

using namespace std;

struct robot

{

	int x,y; 

}r[200005];

int left1[200005];

int right1[200005];

int res[200005];

int cmp(struct robot a,struct robot b)

{

	return a.x<b.x;

}

int main(void)

{

	int n;

	int m;

	while(~scanf("%d %d",&n,&m))

	{

		for(int i=0;i<=n;i++)

		{

			left1[i]=right1[i]=i;

		}

		memset(res,0,sizeof(res));

		for(int i=1;i<=m;i++)

		{

			scanf("%d %d",&r[i].x,&r[i].y);

		}

		sort(r+1,r+m+1,cmp);

		for(int i=1;i<=m;i++)

		{

			int xx=r[i].y;

			left1[xx]=left1[xx+1]=min(left1[xx],left1[xx+1]);

			right1[xx]=right1[xx+1]=max(right1[xx],right1[xx+1]);

		}

		cout<<right1[1]-left1[1]+1;

		for(int i=2;i<=n;i++)

		{

			cout<<" "<<right1[i]-left1[i]+1;

		}

		cout<<endl;

		

		

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.9093281533469073x):
#include <bits/stdc++.h>

#define MAXN 200005

#define MAXM 100005

#define from first

#define to second

using namespace std;

struct arm

{

    int x,y;

    bool operator< (const arm &b) const

    {

        return x<b.x;

    }

}arms[MAXM];

int n,m;

pair<int,int> ans[MAXN];



int main()

{

    scanf("%d%d",&n,&m);

    for(int i=0;i<m;++i)

        scanf("%d%d",&(arms[i].x),&(arms[i].y));

    for(int i=1;i<=n;++i)

        ans[i].from=ans[i].to=i;

    sort(arms,arms+m);

    for(int i=0;i<m;++i)

    {

        int y=arms[i].y;

        ans[y].from=ans[y+1].from=min(ans[y].from,ans[y+1].from);

        ans[y].to=ans[y+1].to=max(ans[y].to,ans[y+1].to);

    }

    for(int i=1;i<=n;++i)

    {

        if(i>1)

            printf(" ");

        printf("%d",ans[i].to-ans[i].from+1);

    }

    printf("\n");

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N=2e5+10;

vector<pair<int,int> >v;

int ans[N],a[N];

int main()

{

    int n,m,i;

    cin>>n>>m;

    for(i=1;i<=n;i++)ans[i]=1;

    for(i=0;i<m;i++)

    {

        int x,y;

        scanf("%d%d",&x,&y);

        v.push_back(make_pair(x,y));

    }

    sort(v.begin(),v.end());

    memset(a,0,sizeof a);

    for(auto x:v)

    {

        int y=x.second;

        ans[y]=ans[y+1]=ans[y]+ans[y+1]-a[y];

        a[y]=ans[y];

    }

    cout<<ans[1];

    for(i=2;i<=n;i++)printf(" %d",ans[i]);

    cout<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8322940143950044x):
#include<cmath>

#include<math.h>

#include<ctype.h>

#include<algorithm>

#include<bitset>

#include<cassert>

#include<cctype>

#include<cerrno>

#include<cfloat>

#include<ciso646>

#include<climits>

#include<clocale>

#include<complex>

#include<csetjmp>

#include<csignal>

#include<cstdarg>

#include<cstddef>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<ctime>

#include<cwchar>

#include<cwctype>

#include<deque>

#include<exception>

#include<fstream>

#include<functional>

#include<iomanip>

#include<ios>

#include<iosfwd>

#include<iostream>

#include<istream>

#include<iterator>

#include<limits>

#include<list>

#include<locale>

#include<map>

#include<memory>

#include<new>

#include<numeric>

#include<ostream>

#include<queue>

#include<set>

#include<sstream>

#include<stack>

#include<stdexcept>

#include<streambuf>

#include<string>

#include<typeinfo>

#include<utility>

#include<valarray>

#include<vector>

#include<string.h>

#include<stdlib.h>

#include<stdio.h>

using namespace std;

struct node

{

	int x,y;

}a[100010];

int n,m;

int f[200010][2];

bool cmp(node x,node y)

{

	return x.x<y.x;

}

int main()

{

	scanf("%d%d",&n,&m);

	for (int i=1;i<=m;i++)

	{

		scanf("%d%d",&a[i].x,&a[i].y);

	}

	sort(a+1,a+m+1,cmp);

	for (int i=1;i<=m;i++)

	{

		int t=a[i].y;

		f[t][1]=max(f[t+1][1]+1,f[t][1]);

		f[t+1][0]=max(f[t][0]+1,f[t+1][0]);

	}

	printf("%d",f[1][0]+f[1][1]+1);

	for (int i=2;i<=n;i++)

	{

		printf(" %d",f[i][0]+f[i][1]+1);

	}

	printf("\n");

    return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<algorithm>

#include<cstring>

using namespace std;

struct robot

{

	int x,y; 

}r[200005];

int left1[200005];

int right1[200005];

int res[200005];

int cmp(struct robot a,struct robot b)

{

	return a.x<b.x;

}

int main(void)

{

	int n;

	int m;

	while(~scanf("%d %d",&n,&m))

	{

		for(int i=0;i<=n;i++)

		{

			left1[i]=right1[i]=i;

		}

		memset(res,0,sizeof(res));

		for(int i=1;i<=m;i++)

		{

			scanf("%d %d",&r[i].x,&r[i].y);

		}

		sort(r+1,r+m+1,cmp);

		for(int i=1;i<=m;i++)

		{

			int xx=r[i].y;

			left1[xx]=left1[xx+1]=min(left1[xx],left1[xx+1]);

			right1[xx]=right1[xx+1]=max(right1[xx],right1[xx+1]);

		}

		cout<<right1[1]-left1[1]+1;

		for(int i=2;i<=n;i++)

		{

			cout<<" "<<right1[i]-left1[i]+1;

		}

		cout<<endl;

		

		

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.9096235580711316x):
#include<cmath>

#include<math.h>

#include<ctype.h>

#include<algorithm>

#include<bitset>

#include<cassert>

#include<cctype>

#include<cerrno>

#include<cfloat>

#include<ciso646>

#include<climits>

#include<clocale>

#include<complex>

#include<csetjmp>

#include<csignal>

#include<cstdarg>

#include<cstddef>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<ctime>

#include<cwchar>

#include<cwctype>

#include<deque>

#include<exception>

#include<fstream>

#include<functional>

#include<iomanip>

#include<ios>

#include<iosfwd>

#include<iostream>

#include<istream>

#include<iterator>

#include<limits>

#include<list>

#include<locale>

#include<map>

#include<memory>

#include<new>

#include<numeric>

#include<ostream>

#include<queue>

#include<set>

#include<sstream>

#include<stack>

#include<stdexcept>

#include<streambuf>

#include<string>

#include<typeinfo>

#include<utility>

#include<valarray>

#include<vector>

#include<string.h>

#include<stdlib.h>

#include<stdio.h>

using namespace std;

struct node

{

	int x,y;

}a[100010];

int n,m;

int f[200010][2];

bool cmp(node x,node y)

{

	return x.x<y.x;

}

int main()

{

	scanf("%d%d",&n,&m);

	for (int i=1;i<=m;i++)

	{

		scanf("%d%d",&a[i].x,&a[i].y);

	}

	sort(a+1,a+m+1,cmp);

	for (int i=1;i<=m;i++)

	{

		int t=a[i].y;

		f[t][1]=max(f[t+1][1]+1,f[t][1]);

		f[t+1][0]=max(f[t][0]+1,f[t+1][0]);

	}

	printf("%d",f[1][0]+f[1][1]+1);

	for (int i=2;i<=n;i++)

	{

		printf(" %d",f[i][0]+f[i][1]+1);

	}

	printf("\n");

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N=2e5+10;

vector<pair<int,int> >v;

int ans[N],a[N];

int main()

{

    int n,m,i;

    cin>>n>>m;

    for(i=1;i<=n;i++)ans[i]=1;

    for(i=0;i<m;i++)

    {

        int x,y;

        scanf("%d%d",&x,&y);

        v.push_back(make_pair(x,y));

    }

    sort(v.begin(),v.end());

    memset(a,0,sizeof a);

    for(auto x:v)

    {

        int y=x.second;

        ans[y]=ans[y+1]=ans[y]+ans[y+1]-a[y];

        a[y]=ans[y];

    }

    cout<<ans[1];

    for(i=2;i<=n;i++)printf(" %d",ans[i]);

    cout<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.826607016760798x):
#include<bits/stdc++.h>

#define ll long long

#define MAX  2147483647

#define fi first

#define se second

#define mid (l+r>>1)

#define fo(i,a,b) for(int i=(a);i<=(b);++i)

#define fodown(i,a,b) for(int i=(a);i>=(b);i--)

using namespace std;

int n,m;

pair<int,int> num[200001];

struct node{

	int x,y;

}a[100001];

int read()

{

   int x=0,tmp=1;

   char ch=getchar();

   while(ch<'0' || ch>'9' ) { if(ch=='-') tmp=-1;ch=getchar();}

   while(ch>='0'&& ch<='9') { x = x * 10+ ch-'0';ch=getchar();}

   return x*tmp;

}

int cmp(node a,node b)

{

    return a.x<b.x;

}

int main()

{

  // freopen(" .in","r",stdin);

  // freopen(" .out","w",stdout);

  n=read();

  m=read();

  fo(i,1,m)

  {

  	 a[i].x=read();

  	 a[i].y=read();

  }

  sort(a+1,a+m+1,cmp);

  fo(i,1,n)

  num[i].fi=i,num[i].se=i;

  int y;

  for(int i=1;i<=m;i++){

  	    y= a[i].y;

        num[y].fi = num[y+1].fi = min(num[y].fi, num[y+1].fi);

        num[y].se = num[y+1].se = max(num[y].se, num[y+1].se);

  }

  fo(i,1,n-1)

  {

    printf("%d ",num[i].se-num[i].fi+1);	

  }

  cout<<num[n].se-num[n].fi+1<<endl;

   return 0;

}