Linear Congruences by kozima

(loop(defun f(e)(dotimes(i(if e #1=(reduce'lcm e :key'cadr))(#2=format t"no solutions
"))(if(loop for(a b)in e always(=(mod i b)a))(return(#2#t"~D + ~Dk
"i #1#)))))(f(loop for(y z a'c)=(read-from-string(#2#/"(~A)"(read-line()/)))while a collect`(,a,c))))

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

download

return to the top page