fork download
  1. s=$3+$2{for(y=$1;(y=x*($2-$3)-2)%s;x--);print x,y/s}
Success #stdin #stdout 0s 5316KB
stdin
5
5 2 5
5 3 2
4 0 1
50 48 49
stdout
-3 1
-3 -1
-3 1
-99 1