#include namespace cplib { template T binary_search(T ok, T ng) { while (std::abs(ok - ng) > 1) { auto x = (ok + ng) / 2; if (f(x)) { ok = x; } else { ng = x; } } return ok; } } #include #include #include #include #include using namespace std; long long s; bool f(long long x) { return x * x <= s; } void solve() { cin >> s; vector ans; while (s > 0) { auto x = cplib::binary_search(1, 1e9 + 5); ans.push_back(x * x); s -= x * x; } cout << ans.size() << '\n'; for (size_t i = 0; i < ans.size(); i++) { cout << ans[i] << (i < ans.size() - 1 ? ' ' : '\n'); } } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int T = 1; for (int t = 0; t < T; t++) { solve(); } return 0; }