Number
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
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 ≤ 10^6
, 1 ≤ c ≤ d ≤ 10^6
).
Output
Print the desired number n.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 67
Acceptance rate 24%