Problem 1.
Find the smallest positive integer such that after dividing it by a number of a given set of integers (the set cannot consist of more than 45 elements), it gives the corresponding nonegative remainder.
Each row of the input file INPUT3.TXT contains a pair of nonnegative integers, the subsequent divisor and remainder.