main=interact$(>>=t).lines t e=break(=='=')e#e (a,_:b)#m|c a/=c b=m++"\n"|1>0="" c=foldl1(%).map read.words b%a|a>b=a+b|a<b=b-a|1>0=a*b
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page