Linear Congruences by yshl

1 0{(%stdin)(r)file 32 string readline not{exit}if dup()eq{pop 2 copy
gt{=only( + )print =only(k)=}{(no solutions)=}ifelse 1 0}{[(=)(d)]{search def
pop token pop exch}forall pop 4 2 roll 10000{dup 3 index mod 4 index eq{exit}if
1 index add}repeat exch 2 index 2 copy{dup 0 eq{exit}if exch 1 index mod}loop
pop idiv mul exch}ifelse}loop

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

download

return to the top page