#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>S; vector ans; while(S){ ll z=sqrtl(S); while(z*z>S) z--; while((z+1)*(z+1)<=S) z++; ans.push_back(z*z); S-=z*z; } cout<