#ifndef INCLUDED_main #define INCLUDED_main #include __FILE__ const ll mod = 998244353; using mint = atcoder::modint998244353; //const ll mod = 1000000007; using mint = atcoder::modint1000000007; // @brief 繰り返し二乗法を利用した、x^nの求値 ll power(ll x, ll n){ ll res = 1; while(n){ if(n & 1) res *= x; // nの2進数表記の下からi(0-indexed)桁目が1なら、x^(2^i)を掛けていく x *= x; n >>= 1; // (n = n>>1 nの各ビットを右へシフト) } return res; } int main(){ ll s; cin >> s; ll M = 1; while(s >= (M+1)*(M+1)) M++; vector ans; while(s >= 1){ while(s < M*M){ M--; } s -= M*M; ans.push_back(M*M); } cout << ans.size() << endl; fore(x, ans) cout << x << ' '; } #else #include #include using ll = long long; using ld = long double; using Graph = std::vector>; #define endl '\n' #define INF 1000000039 #define LLINF 393939393939393939 #define fore(i, a) for(auto &i : a) #define rep(i, a, b) for(int i = a; i < b; i++) #define erep(i, a, b) for(int i = a; i <= b; i++) #define rrep(i, a, b) for(int i = a; i >= b; i--) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define part(x, a, b) x.begin()+a, x.begin()+b+1 #define rpart(x, a, b) x.rbegin()+a, x.rbegin()+b+1 #define pcnt(x) __builtin_popcount(x) #define llpcnt(x) __builtin_popcountll(x) template using pq = std::priority_queue; template using pqg = std::priority_queue, std::greater>; template bool chmax(T &a, const T &b){ if(a < b){ a = b; return 1; } else return 0; } template bool chmin(T &a, const T &b){ if(a > b){ a = b; return 1; } else return 0; } // 多次元配列の生成 template class Mvector : public std::vector>{ public: template Mvector(T init, N n, Sizes... sizes) : std::vector >(n, Mvector(init, sizes...)) { } }; template class Mvector<1, T> : public std::vector{ public: template Mvector(T init, N n) : std::vector(n, init) { } }; using namespace std; #endif