Chinese remainder theorem by olf

f=file("stdin","r")
repeat{d=scan(f,,4)
a=d[1]+d[3]*0:d[4]
write(c(a[a%%d[4]==d[2]],-1)[1],1)}

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

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page