Assume thatagives a remainder 0 < r < d when divided by d and prove that r is a linear combination ofaandbsmaller than d.

You need to make a restriction that some numbers are positive in this problem because d = min{ax + by | x, y in Z} does not exist.