题目链接
∵x>=y∴1/x<=1/y->1/k-1/y<=1/y->y<=2k,所以在2k范围内枚举
#include<cstdio>
int main()
{
int x,y,k;
while(~scanf("%d",&k))
{
int sum=0;
for(y=k+1;y<=2*k;y++)
if((y*k)%(y-k)==0)
{
x=(y*k)/(y-k);
if(x>=y)sum++;
}
printf("%d\n",sum);
for(y=k+1;y<=2*k;y++)
if((y*k)%(y-k)==0)
{
x=(y*k)/(y-k);
if(x>=y)printf("1/%d = 1/%d + 1/%d\n",k,x,y);
}
}
return 0;
}