cho.sh
Notes
Loading...

Unknown Number

Time limit

2s

Memory limit

128 MB

Problem

You must determine one integer.

You are given the following two pieces of information.

  1. The two endpoints of the integer interval where the number may lie
  2. The remainder y when the number is divided by the integer x; equivalently, the number can be written as qx + y for some integer q, with 0 <= y < |x|

If exactly one integer is possible from this information, output that integer. Otherwise, output that the number is unknown.

Input

The first line contains the two endpoints of the interval where the integer may lie.

The second line contains the divisor x and the remainder y.

Every number in the input is an integer between -2^31 and 2^31 - 1, inclusive.

Output

If the possible integer can be determined uniquely, output that integer. If it cannot be determined uniquely, output Unknwon Number.