eolymp
bolt
Try our new interface for solving problems
Problems

Staircase

Staircase

In the fairy land of Vegetables there is a longest staircase in the world, leading to the top of the Watermelon mountain. The bunny is located on the step number x, it can jump a stairs up or b stairs down. At the level of the stair number y there is a magic cabbage, which bunny likes very much. Help him to find, can he jump to the stair number y.

Input

Four integers x, y, a, b (0 < x, y < 106, 0 < |a|, |b| < 100).

Output

Print the minimum number of jumps enough to reach the target, or -1 if its not possible.

Time limit 1 second
Memory limit 128 MiB
Input example #1
10 15 1 3
Output example #1
5
Input example #2
10 15 2 1
Output example #2
4
Input example #3
10 15 3 3
Output example #3
-1
Source Всеукраинская студенческая олимпиада по программированию, ФИНАЛ, Харьков 15 октября 2011, 2-я лига