Language: C++

// ConsoleApplication9.cpp : アプリケーションのエントリ ポイントを定義します。
//


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>// ConsoleApplication9.cpp : アプリケーションのエントリ ポイントを定義します。
//


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>// ConsoleApplication9.cpp : アプリケーションのエントリ ポイントを定義します。
//


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 9999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define p(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
//#define int long long


using namespace std;


int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };




ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}

ll pow2(ll a, ll n) {//aのn乗を計算します。
	ll x = 1;
	while (n > 0) {//全てのbitが捨てられるまで。
		if (n & 1) {//1番右のbitが1のとき。
			x = x * a;
		}
		a = a * a;
		n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
	}
	return x;
}

long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

bool arr[100000100];
vector<ll>sosuu;
void Eratosthenes() {
	ll N = 10000010;
	int c = 0;
	for (int i = 0; i < N; i++) {
		arr[i] = 1;
	}
	for (ll i = 2; i < sqrt(N); i++) {
		if (arr[i]) {
			for (ll j = 0; i * (j + 2) < N; j++) {
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for (ll  i = 2; i < N; i++) {
		if (arr[i]) {
			sosuu.pb(i);
			//cout << sosuu[c] << " ";
			c++;
		}
	}
	//cout << endl;
	//cout << c << endl;
}

ll stoL(string s) {
	ll n = s.length();
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		ans += pow2(10, n - i-1)*(ll)(s[i]-'0');
	}
	return ans;
}

vector<int> v;
void dfs(int n, ll S) {
	if (S > 0) {
		for (int i = n - 1; i >= 0; i--) {
			if (i <= S) {
				v.pb(i);
				dfs(i, S - i);
				break;
			}
		}
	}
}
ll sum[10000000];
int main() {
	int N; cin >> N;
	
	sum[0] = 0;
	FOR(i,1, 10000000) {
		sum[i] = sum[i-1] + i;
	}
	int n = 0;
	REP(i, N+1) {
		if (sum[i] >= N) {
			v.pb(i);
			n = i;
			break;
		}
	}
	dfs(n, N - v[0]);
	VSORT(v);
	for (auto x : v) {
		p(x);
	}
}


#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 9999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define p(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
//#define int long long


using namespace std;


int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };




ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}

ll pow2(ll a, ll n) {//aのn乗を計算します。
	ll x = 1;
	while (n > 0) {//全てのbitが捨てられるまで。
		if (n & 1) {//1番右のbitが1のとき。
			x = x * a;
		}
		a = a * a;
		n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
	}
	return x;
}

long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

bool arr[100000100];
vector<ll>sosuu;
void Eratosthenes() {
	ll N = 10000010;
	int c = 0;
	for (int i = 0; i < N; i++) {
		arr[i] = 1;
	}
	for (ll i = 2; i < sqrt(N); i++) {
		if (arr[i]) {
			for (ll j = 0; i * (j + 2) < N; j++) {
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for (ll  i = 2; i < N; i++) {
		if (arr[i]) {
			sosuu.pb(i);
			//cout << sosuu[c] << " ";
			c++;
		}
	}
	//cout << endl;
	//cout << c << endl;
}

ll stoL(string s) {
	ll n = s.length();
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		ans += pow2(10, n - i-1)*(ll)(s[i]-'0');
	}
	return ans;
}

vector<int> v;
void dfs(int n, ll S) {
	if (S > 0) {
		for (int i = n - 1; i >= 0; i--) {
			if (i <= S) {
				v.pb(i);
				dfs(i, S - i);
				break;
			}
		}
	}
}
ll sum[10000000];
int main() {
	int N; cin >> N;
	
	sum[0] = 0;
	FOR(i,1, 10000000) {
		sum[i] = sum[i-1] + i;
	}
	int n = 0;
	REP(i, N+1) {
		if (sum[i] >= N) {
			v.pb(i);
			n = i;
			break;
		}
	}
	dfs(n, N - v[0]);
	VSORT(v);
	for (auto x : v) {
		p(x);
	}
}


#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 9999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define p(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
//#define int long long


using namespace std;


int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };




ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}

ll pow2(ll a, ll n) {//aのn乗を計算します。
	ll x = 1;
	while (n > 0) {//全てのbitが捨てられるまで。
		if (n & 1) {//1番右のbitが1のとき。
			x = x * a;
		}
		a = a * a;
		n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
	}
	return x;
}

long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

bool arr[100000100];
vector<ll>sosuu;
void Eratosthenes() {
	ll N = 10000010;
	int c = 0;
	for (int i = 0; i < N; i++) {
		arr[i] = 1;
	}
	for (ll i = 2; i < sqrt(N); i++) {
		if (arr[i]) {
			for (ll j = 0; i * (j + 2) < N; j++) {
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for (ll  i = 2; i < N; i++) {
		if (arr[i]) {
			sosuu.pb(i);
			//cout << sosuu[c] << " ";
			c++;
		}
	}
	//cout << endl;
	//cout << c << endl;
}

ll stoL(string s) {
	ll n = s.length();
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		ans += pow2(10, n - i-1)*(ll)(s[i]-'0');
	}
	return ans;
}

vector<int> v;
void dfs(int n, ll S) {
	if (S > 0) {
		for (int i = n - 1; i >= 0; i--) {
			if (i <= S) {
				v.pb(i);
				dfs(i - 1, S - i);
				break;
			}
		}
	}
}
ll sum[10000000];
int main() {
	int N; cin >> N;
	
	sum[0] = 0;
	FOR(i,1, 10000000) {
		sum[i] = sum[i-1] + i;
	}
	int n = 0;
	REP(i, N+1) {
		if (sum[i] >= N) {
			v.pb(i);
			n = i;
			break;
		}
	}
	dfs(n, N - v[0]);
	VSORT(v);
	for (auto x : v) {
		p(x);
	}
}



Compiler output:
a.cc:238:5: error: redefinition of 'int dy [4]'
  238 | int dy[4] = { 0,0,1,-1 };
      |     ^~
a.cc:59:5: note: 'int dy [4]' previously defined here
   59 | int dy[4] = { 0,0,1,-1 };
      |     ^~
a.cc:239:5: error: redefinition of 'int dx [4]'
  239 | int dx[4] = { 1,-1,0,0 };
      |     ^~
a.cc:60:5: note: 'int dx [4]' previously defined here
   60 | int dx[4] = { 1,-1,0,0 };
      |     ^~
a.cc:240:5: error: redefinition of 'int dxx [8]'
  240 | int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
      |     ^~~
a.cc:61:5: note: 'int dxx [8]' previously defined here
   61 | int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
      |     ^~~
a.cc:241:5: error: redefinition of 'int dyy [8]'
  241 | int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };
      |     ^~~
a.cc:62:5: note: 'int dyy [8]' previously defined here
   62 | int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };
      |     ^~~
a.cc:246:4: error: redefinition of 'long long int gcd(long long int, long long int)'
  246 | ll gcd(ll x, ll y) {
      |    ^~~
a.cc:67:4: note: 'long long int gcd(long long int, long long int)' previously defined here
   67 | ll gcd(ll x, ll y) {
      |    ^~~
a.cc:251:4: error: redefinition of 'long long int lcm(long long int, long long int)'
  251 | ll lcm(ll x, ll y) {
      |    ^~~
a.cc:72:4: note: 'long long int lcm(long long int, long long int)' previously defined here
   72 | ll lcm(ll x, ll y) {
      |    ^~~
a.cc:255:4: error: redefinition of 'long long int myPow(long long int, long long int, long long int)'
  255 | ll myPow(ll x, ll n, ll m) {
      |    ^~~~~
a.cc:76:4: note: 'long long int myPow(long long int, long long int, long long int)' previously defined here
   76 | ll myPow(ll x, ll n, ll m) {
      |    ^~~~~
a.cc:264:4: error: redefinition of 'long long int pow2(long long int, long long int)'
  264 | ll pow2(ll a, ll n) {//aのn乗を計算します。
      |    ^~~~
a.cc:85:4: note: 'long long int pow2(long long int, long long int)' previously defined here
   85 | ll pow2(ll a, ll n) {//aのn乗を計算します。
      |    ^~~~
a.cc:276:11: error: redefinition of 'long long int nCr(int, int)'
  276 | long long nCr(int n, int r) {
      |           ^~~
a.cc:97:11: note: 'long long int nCr(int, int)' previously defined here
   97 | long long nCr(int n, int r) {
      |           ^~~
a.cc:289:11: error: redefinition of 'const int MAX'
  289 | const int MAX = 510000;
      |           ^~~
a.cc:110:11: note: 'const int MAX' previously defined here
  110 | const int MAX = 510000;
      |           ^~~
a.cc:290:11: error: redefinition of 'const int MOD'
  290 | const int MOD = 1000000007;
      |           ^~~
a.cc:111:11: note: 'const int MOD' previously defined here
  111 | const int MOD = 1000000007;
      |           ^~~
a.cc:292:11: error: redefinition of 'long long int fac [510000]'
  292 | long long fac[MAX], finv[MAX], inv[MAX];
      |           ^~~
a.cc:113:11: note: 'long long int fac [510000]' previously declared here
  113 | long long fac[MAX], finv[MAX], inv[MAX];
      |           ^~~
a.cc:292:21: error: redefinition of 'long long int finv [510000]'
  292 | long long fac[MAX], finv[MAX], inv[MAX];
      |                     ^~~~
a.cc:113:21: note: 'long long int finv [510000]' previously declared here
  113 | long long fac[MAX], finv[MAX], inv[MAX];
      |                     ^~~~
a.cc:292:32: error: redefinition of 'long long int inv [510000]'
  292 | long long fac[MAX], finv[MAX], inv[MAX];
      |                                ^~~
a.cc:113:32: note: 'long long int inv [510000]' previously declared here
  113 | long long fac[MAX], finv[MAX], inv[MAX];
      |                                ^~~
a.cc:295:6: error: redefinition of 'void COMinit()'
  295 | void COMinit() {
      |      ^~~~~~~
a.cc:116:6: note: 'void COMinit()' previously defined here
  116 | void COMinit() {
      |      ^~~~~~~
a.cc:307:11: error: redefinition of 'long long int COM(int, int)'
  307 | long long COM(int n, int k) {
      |           ^~~
a.cc:128:11: note: 'long long int COM(int, int)' previously defined here
  128 | long long COM(int n, int k) {
      |           ^~~
a.cc:313:6: error: redefinition of 'bool arr [100000100]'
  313 | bool arr[100000100];
      |      ^~~
a.cc:134:6: note: 'bool arr [100000100]' previously declared here
  134 | bool arr[100000100];
      |      ^~~
a.cc:314:11: error: redefinition of 'std::vector<long long int> sosuu'
  314 | vector<ll>sosuu;
      |           ^~~~~
a.cc:135:11: note: 'std::vector<long long int> sosuu' previously declared here
  135 | vector<ll>sosuu;
      |           ^~~~~
a.cc:315:6: error: redefinition of 'void Eratosthenes()'
  315 | void Eratosthenes() {
      |      ^~~~~~~~~~~~
a.cc:136:6: note: 'void Eratosthenes()' previously defined here
  136 | void Eratosthenes() {
      |      ^~~~~~~~~~~~
a.cc:340:4: error: redefinition of 'long long int stoL(std::string)'
  340 | ll stoL(string s) {
      |    ^~~~
a.cc:161:4: note: 'long long int stoL(std::string)' previously defined here
  161 | ll stoL(string s) {
      |    ^~~~
a.cc:349:13: error: redefinition of 'std::vector<int> v'
  349 | vector<int> v;
      |             ^
a.cc:170:13: note: 'std::vector<int> v' previously declared here
  170 | vector<int> v;
      |             ^
a.cc:350:6: error: redefinition of 'void dfs(int, long long int)'
  350 | void dfs(int n, ll S) {
      |      ^~~
a.cc:171:6: note: 'void dfs(int, long long int)' previously defined here
  171 | void dfs(int n, ll S) {
      |      ^~~
a.cc:361:4: error: redefinition of 'long long int sum [10000000]'
  361 | ll sum[10000000];
      |    ^~~
a.cc:182:4: note: 'long long int sum [10000000]' previously declared here
  182 | ll sum[10000000];
      |    ^~~
a.cc:362:5: error: redefinition of 'int main()'
  362 | int main() {
      |     ^~~~
a.cc:183:5: note: 'int main()' previously defined here
  183 | int main() {
      |     ^~~~
a.cc:416:5: error: redefinition of 'int dy [4]'
  416 | int dy[4] = { 0,0,1,-1 };
      |     ^~
a.cc:59:5: note: 'int dy [4]' previously defined here
   59 | int dy[4] = { 0,0,1,-1 };
      |     ^~
a.cc:417:5: error: redefinition of 'int dx [4]'
  417 | int dx[4] = { 1,-1,0,0 };
      |     ^~
a.cc:60:5: note: 'int dx [4]' previously defined here
   60 | int dx[4] = { 1,-1,0,0 };
      |     ^~
a.cc:418:5: error: redefinition of 'int dxx [8]'
  418 | int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
      |     ^~~
a.cc:61:5: note: 'int dxx [8]' previously defined here
   61 | int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
      |     ^~~
a.cc:419:5: error: redefinition of 'int dyy [8]'
  419 | int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };
      |     ^~~
a.cc:62:5: note: 'int dyy [8]' previously defined here
   62 | int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };
      |     ^~~
a.cc:424:4: error: redefinition of 'long long int gcd(long long int, long long int)'
  424 | ll gcd(ll x, ll y) {
      |    ^~~
a.cc:67:4: note: 'long long int gcd(long long int, long long int)' previously defined here
   67 | ll gcd(ll x, ll y) {
      |    ^~~
a.cc:429:4: error: redefinition of 'long long int lcm(long long int, long long int)'
  429 | ll lcm(ll x, ll y) {
      |    ^~~
a.cc:72:4: note: 'long long int lcm(long long int, long long int)' previously defined here
   72 | ll lcm(ll x, ll y) {
      |    ^~~
a.cc:433:4: error: redefinition of 'long long int myPow(long long int, long long int, long long int)'
  433 | ll myPow(ll x, ll n, ll m) {
      |    ^~~~~
a.cc:76:4: note: 'long long int myPow(long long int, long long int, long long int)' previously defined here
   76 | ll myPow(ll x, ll n, ll m) {
      |    ^~~~~
a.cc:442:4: error: redefinition of 'long long int pow2(long long int, long long int)'
  442 | ll pow2(ll a, ll n) {//aのn乗を計算します。
      |    ^~~~
a.cc:85:4: note: 'long long int pow2(long long int, long long int)' previously defined here
   85 | ll pow2(ll a, ll n) {//aのn乗を計算します。
      |    ^~~~
a.cc:454:11: error: redefinition of 'long long int nCr(int, int)'
  454 | long long nCr(int n, int r) {
      |           ^~~
a.cc:97:11: note: 'long long int nCr(int, int)' previously defined here
   97 | long long nCr(int n, int r) {
      |           ^~~
a.cc:467:11: error: redefinition of 'const int MAX'
  467 | const int MAX = 510000;
      |           ^~~
a.cc:110:11: note: 'const int MAX' previously defined here
  110 | const int MAX = 510000;
      |           ^~~
a.cc:468:11: error: redefinition of 'const int MOD'
  468 | const int MOD = 1000000007;
      |           ^~~
a.cc:111:11: note: 'const int MOD' previously defined here
  111 | const int MOD = 1000000007;
      |           ^~~
a.cc:470:11: error: redefinition of 'long long int fac [510000]'
  470 | long long fac[MAX], finv[MAX], inv[MAX];
      |           ^~~
a.cc:113:11: note: 'long long int fac [510000]' previously declared here
  113 | long long fac[MAX], finv[MAX], inv[MAX];
      |           ^~~
a.cc:470:21: error: redefinition of 'long long int finv [510000]'
  470 | long long fac[MAX], finv[MAX], inv[MAX];
      |                     ^~~~
a.cc:113:21: note: 'long long int finv [510000]' previously declared here
  113 | long long fac[MAX], finv[MAX], inv[MAX];
      |                     ^~~~
a.cc:470:32: error: redefinition of 'long long int inv [510000]'
  470 | long long fac[MAX], finv[MAX], inv[MAX];
      |                                ^~~
a.cc:113:32: note: 'long long int inv [510000]' previously declared here
  113 | long long fac[MAX], finv[MAX], inv[MAX];
      |                                ^~~
a.cc:473:6: error: redefinition of 'void COMinit()'
  473 | void COMinit() {
      |      ^~~~~~~
a.cc:116:6: note: 'void COMinit()' previously defined here
  116 | void COMinit() {
      |      ^~~~~~~
a.cc:485:11: error: redefinition of 'long long int COM(int, int)'
  485 | long long COM(int n, int k) {
      |           ^~~
a.cc:128:11: note: 'long long int COM(int, int)' previously defined here
  128 | long long COM(int n, int k) {
      |           ^~~
a.cc:491:6: error: redefinition of 'bool arr [100000100]'
  491 | bool arr[100000100];
      |      ^~~
a.cc:134:6: note: 'bool arr [100000100]' previously declared here
  134 | bool arr[100000100];
      |      ^~~
a.cc:492:11: error: redefinition of 'std: