#include using std::cout; using std::endl; using std::cin; int main(){ int n; cin >> n; for(int i = 1; i <= 250; i++){ int A = i * (i - 1) / 2; int X = n - A; if(X % i) continue; int Z = X / i; if(i + Z > 250) continue; cout << i + Z << endl; for(int j = 0; j < i; j++) cout << 1 << " "; for(int j = 0; j < Z; j++) cout << 2 << " "; cout << endl; return 0; } assert(false); return 0; }