Problems
Number
Number
Given the numbers a, b, c and d find the smallest positive integer n, greater than a * c, which cannot be represented as the product of two natural numbers u and v such that a ≤ u ≤ b и c ≤ v ≤ d.
Input
Positive integers a, b, c, d (1 ≤ a ≤ b ≤ 106
, 1 ≤ c ≤ d ≤ 106
).
Output
Print the desired number n.
Input example #1
1 2 1 2
Output example #1
3
Input example #2
1 2 3 5
Output example #2
7