#Q211. 「一本通 6.4 例 1」青蛙的约会

「一本通 6.4 例 1」青蛙的约会

Description

Original Source: POJ 1061

Two frogs met online and had a great conversation, so they decided to meet in person. They were delighted to find out that they lived on the same latitude line, so they agreed to jump westward until they met. However, they forgot something very important before setting off—they neither asked about each other's distinguishing features nor agreed on a specific meeting location. But frogs are optimistic creatures; they believed that as long as they kept jumping in a certain direction, they would eventually meet. Unless both frogs landed on the same point at the same time, they would never meet. To help these two optimistic frogs, you are asked to write a program to determine whether they can meet and, if so, after how many jumps.

We name the two frogs Frog A and Frog B and define the longitude line with 0 degrees east as the origin, the positive direction from east to west, and a unit length of 1 meter. This gives us a number axis that loops around. Let the starting coordinate of Frog A be xx and that of Frog B be yy. Frog A can jump mm meters per jump, and Frog B can jump nn meters per jump. Both frogs take the same amount of time for each jump. The total length of the latitude line is LL meters. Your task is to determine how many jumps they need to make before they meet.

Input Format

The input consists of a single line containing five integers xx, yy, mm, nn, and LL.

Output Format

Output the number of jumps required for them to meet. If it is impossible for them to meet, output Impossible.

Sample 1

1 2 3 4 5

4

Constraints & Hints

For 100%100\% of the data, 0x,y<2×1090 \le x, y \lt 2 \times 10^9, 0<m,n<2×1090 \lt m, n \lt 2 \times 10^9, and 0<L<2.1×1090 \lt L \lt 2.1 \times 10^9. It is guaranteed that xyx \neq y.