输入正整数k,找到所有的正整数x>=y,使得1/k=1/x+1/y
样例输入
2
12
样例输出
1/2=1/6+1/3
1/2=1/4+1/4
1/12=1/156+1/13
1/12=1/84+1/14
1/12=1/60+1/15
1/12=1/48+1/16
1/12=1/36+1/18
1/12=1/30+1/20
1/12=1/28+1/21
样例输入
2
12
样例输出
1/2=1/6+1/3
1/2=1/4+1/4
1/12=1/156+1/13
1/12=1/84+1/14
1/12=1/60+1/15
1/12=1/48+1/16
1/12=1/36+1/18
1/12=1/30+1/20
1/12=1/28+1/21
1/12=1/24+1/24
#define _CRT_SECURE_NO_WARNINGS
#include<stdlib.h>
#include<stdio.h>
int meiju(int n)
{
int y;
int x;
for (int x = n + 1; x <= 2 * n; x++)
{
if (n*x % (x - n) == 0)
{
if ((n*x)/(x - n)>=x)
{
y = (n*x) / (x - n);
printf("1/%d=1/%d+1/%d\n", n, y, x);
}
}
}
return 0;
}
int main()
{
int num;
scanf("%d", &num);
meiju(num);
system("pause");
return 0;
}