stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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'



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



#define MOD_IS_PRIME

constexpr ll mod = 1000000007LL;



int main() {

	ios::sync_with_stdio(false);

	std::cin.tie(0);



	constexpr int K = 16;



	vector<ll> v_e = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };

	vector<ll> v_o = { 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };



	int T; cin >> T;

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

		ll N; cin >> N;

		if (N % 2 == 0) {// even

			ll ans = 0;

			ll x = 1;

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

				ans += (x * v_e[i]) % mod;

				x = (x * N) % mod;

			}

			cout << ans % mod << endl;

		}

		else {// odd

			ll ans = 0;

			ll x = 1;

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

				ans += (x * v_o[i]) % mod;

				x = (x * N) % mod;

			}

			cout << ans % mod << endl;

		}

	}



	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



typedef long long ll;



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

const ll mod = 1000000007LL;



class modlong {

public:

	modlong() { x = 0; }

	modlong(ll num) { x = num; }

	inline operator ll() const { return x; }

	inline void operator = (ll num) { x = num; }

	inline void operator += (ll num) { x = adjust(x + num); }

	inline void operator *= (ll num) { x = adjust(x * num); }

	inline modlong operator * (ll num) { modlong m(adjust(this->x * num)); return m; }

private:

	inline ll adjust(ll a) {

		if (a >= mod) { return a % mod; }

		return a;

	}

	ll x;

};



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("%ld", &N);

		modlong ans = 0;

		modlong x = 1;



		if (N & 1) {// odd

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

				ans += x * v_o[i];

				x *= N;

			}

		}

		else {// even

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

				ans += x * v_e[i];

				x *= N;

			}

		}

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

	}



	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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'



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



#define MOD_IS_PRIME

constexpr ll mod = 1000000007LL;



int main() {

	ios::sync_with_stdio(false);

	std::cin.tie(0);



	constexpr int K = 16;



	vector<ll> v_e = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };

	vector<ll> v_o = { 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };



	int T; cin >> T;

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

		ll N; cin >> N;

		if (N % 2 == 0) {// even

			ll ans = 0;

			ll x = 1;

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

				ans += x * v_e[i];

				x *= N;

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

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

			}

			cout << ans << endl;

		}

		else {// odd

			ll ans = 0;

			ll x = 1;

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

				ans += x * v_o[i];

				x *= N;

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

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

			}

			cout << ans << endl;

		}

	}



	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



typedef long long ll;



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

const ll mod = 1000000007LL;



class modlong {

public:

	modlong() { x = 0; }

	modlong(ll num) { x = num; }

	inline operator ll() const { return x; }

	inline void operator = (ll num) { x = num; }

	inline void operator += (ll num) { x = adjust(x + num); }

	inline void operator *= (ll num) { x = adjust(x * num); }

	inline modlong operator * (ll num) { modlong m(adjust(this->x * num)); return m; }

private:

	inline ll adjust(ll a) {

		if (a >= mod) { return a % mod; }

		return a;

	}

	ll x;

};



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("%ld", &N);

		modlong ans = 0;

		modlong x = 1;



		if (N & 1) {// odd

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

				ans += x * v_o[i];

				x *= N;

			}

		}

		else {// even

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

				ans += x * v_e[i];

				x *= N;

			}

		}

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

	}



	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



typedef long long ll;



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

const ll mod = 1000000007LL;



class modlong {

public:

	modlong() { x = 0; }

	modlong(ll num) { x = num; }

	inline operator ll() const { return x; }

	inline void operator = (ll num) { x = num; }

	inline void operator += (ll num) { x = adjust(x + num); }

	inline void operator *= (ll num) { x = adjust(x * num); }

	inline modlong operator * (ll num) { modlong m(adjust(this->x * num)); return m; }

private:

	inline ll adjust(ll a) {

		if (a >= mod) { return a % mod; }

		return a;

	}

	ll x;

};



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("%ld", &N);

		modlong ans = 0;

		modlong x = 1;



		if (N & 1) {// odd

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

				ans += x * v_o[i];

				x *= N;

			}

		}

		else {// even

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

				ans += x * v_e[i];

				x *= N;

			}

		}

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

	}



	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



typedef long long ll;



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

const ll mod = 1000000007LL;



class modlong {

public:

	modlong() { x = 0; }

	modlong(ll num) { x = num; }

	inline operator ll() const { return x; }

	inline void operator = (ll num) { x = num; }

	inline void operator += (ll num) { x = adjust(x + num); }

	inline void operator *= (ll num) { x = adjust(x * num); }

	inline modlong operator * (ll num) { modlong m(adjust(this->x * num)); return m; }

private:

	inline ll adjust(ll a) {

		if (a >= mod) { return a % mod; }

		return a;

	}

	ll x;

};



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("%ld", &N);

		modlong ans = 0;

		modlong x = 1;



		if (N & 1) {// odd

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

				ans += x * v_o[i];

				x *= N;

			}

		}

		else {// even

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

				ans += x * v_e[i];

				x *= N;

			}

		}

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

	}



	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



typedef long long ll;



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

const ll mod = 1000000007LL;



class modlong {

public:

	modlong() { x = 0; }

	modlong(ll num) { x = num; }

	inline operator ll() const { return x; }

	inline void operator = (ll num) { x = num; }

	inline void operator += (ll num) { x = adjust(x + num); }

	inline void operator *= (ll num) { x = adjust(x * num); }

	inline modlong operator * (ll num) { modlong m(adjust(this->x * num)); return m; }

private:

	inline ll adjust(ll a) {

		if (a >= mod) { return a % mod; }

		return a;

	}

	ll x;

};



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("%ld", &N);

		modlong ans = 0;

		modlong x = 1;



		if (N & 1) {// odd

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

				ans += x * v_o[i];

				x *= N;

			}

		}

		else {// even

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

				ans += x * v_e[i];

				x *= N;

			}

		}

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

	}



	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//

//	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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <cstring>

#include <cstdio>

#include <algorithm>

#define maxn 200005



using namespace std;



int n,m,ans[maxn][3];

struct node

{

    int x,y;

    bool operator <(const node &a)const

    {

        return x<a.x;

    }

}d[maxn/2];



int main()

{



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

    for (int i=0;i<m;i++) scanf("%d%d",&d[i].x,&d[i].y);

    sort(d,d+m);

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

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

    {

      

        int p=d[i].y,t1=ans[p][1],t2=ans[p+1][1];

        ans[p][1]+=t2-ans[p][2];

        ans[p+1][1]+=t1-ans[p+1][0];



        ans[p][2]=ans[p+1][1];

        ans[p+1][0]=ans[p][1];

    }

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

    printf("%d\n",ans[n][1]);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

		

		

	}

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <cstring>

#include <cstdio>

#include <algorithm>

#define maxn 200005



using namespace std;



int n,m,ans[maxn][3];

struct node

{

    int x,y;

    bool operator <(const node &a)const

    {

        return x<a.x;

    }

}d[maxn/2];



int main()

{



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

    for (int i=0;i<m;i++) scanf("%d%d",&d[i].x,&d[i].y);

    sort(d,d+m);

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

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

    {

      

        int p=d[i].y,t1=ans[p][1],t2=ans[p+1][1];

        ans[p][1]+=t2-ans[p][2];

        ans[p+1][1]+=t1-ans[p+1][0];



        ans[p][2]=ans[p+1][1];

        ans[p+1][0]=ans[p][1];

    }

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

    printf("%d\n",ans[n][1]);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{

  int N, M;

  int dp1[200000], dp2[200000];

  vector< int > line[100001];

  iota(dp1, dp1 + 200000, 0);

  iota(dp2, dp2 + 200000, 0);



  scanf("%d %d", &N, &M);

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

    int a, b;

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

    line[a].push_back(b);

  }

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

    for(auto& j : line[i]) {

      dp2[j - 1] = dp2[j];

      dp1[j] = dp1[j - 1];

    }

  }

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

    if(i > 0) putchar(' ');

    printf("%d", dp2[i] - dp1[i] + 1);

  }

  puts("");

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;



int main()

{

  int n, m, l[200000], r[200000];

  vector< int > line[100001];



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

  for(int i = 0; i < n; i++) l[i] = r[i] = i;

  while(m--) {

    int x, y;

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

    line[x].push_back(y);

  }

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

    for(auto &p : line[i]) {

      l[p] = l[p - 1];

      r[p - 1] = r[p];

    }

  }

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

    if(i > 0) putchar(' ');

    printf("%d", r[i] - l[i] + 1);

  }

  putchar('\n');

}

// Fastest known solution for this problem: