/***********************************************************
egypfrac.c -- エジプトの分数
***********************************************************/
#N88BASIC

Dim m As Long, n As Long, q As Long


Input "分子 m = ", m
Input "分母 n = ", n

While (n mod m) <> 0
q = n / m + 1
Print "1/" ; q ; "+ ";
m = m * q - n : n = n * q
Wend
Print "1/"; + n/m