#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N; int ans = 0; vector> res; rep(x, 0, 1000){ rep(y, 0, 1000){ if(x == 0 && y == 0) continue; int w = N - x*y; if(w % (x + y) != 0 || w < 0) continue; ans++; int z = w / (x + y); res.push_back({x,y,z}); } } cout << ans << endl; for(auto [x, y, z] : res){ cout << x << ' ' << y << ' ' << z << endl; } return 0; }