finish whole program
fix negative solution bug

Previously, in the function a0 x = b0 (mod n), a0 is guaranteed to be
positive, but b0 was neglected. b0 also needs to be positive (actually
better in the range [1, n-1]) to assure that (x0 * b0) % n is positive.