System.in.eachLine{{x,y->g=(x*1g).gcd(y) x=x/g+0 println y>g?"$x/${y/g+0}":x}it.split('/')*.toLong()}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page