#include using namespace std; using ll=long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define all(v) v.begin(),v.end() template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a> n; ll q=sqrtl(n)+100; set> ans; rep(y,q){ rep(z,q){ if(y+z==0) continue; if((n-y*z)%(y+z)!=0) continue; ll x=(n-y*z)/(y+z); if(x<0) continue; vector v={x,y,z}; sort(all(v)); do{ ans.insert(v); }while(next_permutation(all(v))); } } cout << (ll)ans.size() << '\n'; for(auto &v:ans){ for(auto &i:v){ cout << i << ' '; } cout << '\n'; } }