#include using namespace std; #ifdef LOCAL #include "debug.hpp" #else #define debug(...) 1 #endif const int MX = 3300; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector> ans; for (int x = 0; x <= MX; x++) { for (int y = 0; y <= MX; y++) { if (x == 0 && y == 0) { continue; } if (n - x * y < 0) { continue; } if ((n - x * y) % (x + y) == 0) { ans.emplace_back(x, y, (n - x * y) / (x + y)); } } } cout << ans.size() << '\n'; for (int i = 0; i < (int) ans.size(); i++) { cout << get<0>(ans[i]) << ' ' << get<1>(ans[i]) << ' ' << get<2>(ans[i]) << '\n'; } }