Bigint(int x = 0){ memset(a, 0, sizeof(a)); for (len = 1; x; len++){ a[len] = x % 10; x /= 10; } len--; } int &operator[](int i) {return a[i];}
voidflatten(int L){ len = L; for (int i = 1; i <= len; i++){ a[i + 1] += a[i] / 10; a[i] = a[i] % 10; } while(!a[len]) len--; }
Bigint operator*(int b) const{ Bigint c; for (int i = 1; i <= len; i++) c[i] = a[i] * b; c.flatten(len + to_string(b).length()); return c; }
voidprint(){ for (int i = len; i >= 1; i--){ cout << a[i]; } } };
intmain(){ int n; cin >> n;
vector <int> q; int sum = 0; if (n >= 4){ for (int i = 2; i + sum <= n; i++){ q.push_back(i); sum += i; } int p = q.size() - 1; int t = n - sum; while (t){ if (p == -1) p = q.size() - 1; q[p]++; p--; t--; } for (auto tmp : q) cout << tmp << " "; cout << "\n";
Bigint ans(1); for (auto tmp : q){ ans = ans * tmp; } ans.print(); } else cout << n; return0; }