#include using namespace std; using namespace chrono; #if __has_include() #include using namespace atcoder; #endif int main() { int64_t s; cin >> s; vector as; int64_t x = 1; while ((x + 1) * (x + 1) <= s) { x++; } while (0 < s) { while (x * x <= s) { as.push_back(x * x); s -= x * x; } x = 1; while ((x + 1) * (x + 1) <= s) { x++; } } cout << as.size() << endl; for (auto &&a : as) { cout << a << ' '; } cout << endl; return 0; }