/* -*- coding: utf-8 -*- * * 2479.cc: No.2479 Sum of Squares - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 15; /* typedef */ typedef long long ll; /* global variables */ ll as[MAX_N]; /* subroutines */ inline int sqrti(ll s) { int t0 = 0, t1 = 1000000000 + 1; while (t0 + 1 < t1) { int t = (t0 + t1) / 2; if ((ll)t * t > s) t1 = t; else t0 = t; } return t0; } /* main */ int main() { ll s; scanf("%lld\n", &s); int n = 0; while (s > 0) { int t = sqrti(s); ll tt = (ll)t * t; as[n++] = tt; s -= tt; } printf("%d\n", n); for (int i = 0; i < n; i++) printf("%lld%c", as[i], (i + 1 < n) ? ' ' : '\n'); return 0; }