#include using namespace std; #if __has_include("Today's/debug.cpp") #include "Today's/debug.cpp" #else #define debug(...) #define print_line #define debugc(...) #define cerr \ if (false) cerr #endif mt19937 mt; random_device rnd; void run() { long long s; cin >> s; auto Solve = [&]() { vector A; while (s > 0) { long long now = 1; while ((now + 1) * (now + 1) <= s) { now++; } A.push_back(now * now); s -= now * now; } cout << A.size() << endl; for (int i = 0; i < (int)A.size(); i++) { cout << A[i] << ' '; } cout << endl; }; Solve(); } int main() { mt.seed(rnd()); ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; // cin >> t; while (t--) { run(); } }