#include #include using namespace std; int main(){ int K; cin >> K; for (int x = 0; x <= 30; x++){ for (int y = 0; y <= 30 - x; y++){ if (((y * (y - 1) / 2) << x) == K && x + y > 0){ vector b; for (int i = 0; i < x; i++){ b.push_back(0); } for (int i = 0; i < y; i++){ b.push_back(1); } int N = b.size(); cout << N << endl; for (int i = 0; i < N; i++){ cout << b[i]; if (i < N - 1){ cout << ' '; } } cout << endl; return 0; } } } }