#Algorithm
把式子变成x = ky/(y-k)
又 x >= y
所以 y<=2k
然后枚举y
#Code
#include <cstdio>
#include <vector>
#include <iostream>
using namespace std;
struct V
{
int x, y;
V(int x, int y) : x(x), y(y){}
};
int main()
{
int k;
while (scanf("%d", &k) != EOF)
{
vector<V> v;
for (int y = k + 1; y <= 2 * k; y++)
{
if ((y * k) % (y - k) == 0)
{
int x = (y * k) / (y - k);
v.push_back(V(x, y));
}
}
printf("%d\n", v.size());
for (int i = 0; i < v.size(); i++)
printf("1/%d = 1/%d + 1/%d\n", k, v[i].x, v[i].y);
}
}