FRACTRAN fixed by hallvabo

a=map(int,raw_input().split())
n,m=input(),input()
print n
i=0
while m:
 x,y=a[i:i+2];i+=2
 if n*x%y<1:n=n*x/y;i=0;m-=1;print n

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page