#Z14122. 余数相同问题

余数相同问题

Description

Given three positive integers a, b, and c, find the smallest integer x greater than 1 such that when x is used as a divisor for a, b, and c, the remainders are the same. It is guaranteed that a solution exists.

Input Format

One line containing three positive integers a, b, and c, each not exceeding 1,000,000, separated by a single space.

Output Format

A single integer representing the smallest x that satisfies the given condition.

300 262 205

19