- 166

## Statement

## Goal

A building has`n`floors.

It has an elevator that is controlled by two buttons only:

By pressing the

`a`floors up.

By pressing the

`b`floors down.

If the elevator is commanded to go lower than the first floor or higher than the

`n`-th floor, it will refuse to move and remain on its current floor.

The elevator starts on the

`k`-th floor. Count how many times the buttons should be pressed to move the elevator to the

`m`-th floor.

Input

**Line 1:**5 space separated integers in order:

`n`

`a`

`b`

`k`

`m`

Output

One line that contains 1 integer - minimal number of buttons pressed, required to move the elevator to the floor

If it is impossible to move the elevator to the floorIMPOSSIBLE

`m`.If it is impossible to move the elevator to the floor

`m`, printConstraints

1 ≤

1 ≤

1 ≤

1 ≤

1 ≤

`n`≤ 100001 ≤

`a`≤`n`1 ≤

`b`≤`n`1 ≤

`k`≤`n`1 ≤

`m`≤`n`Example

Input

10 1 1 8 5

Output

3

A higher resolution is required to access the IDE

Online Participants

### Channels

### Direct Messages

No private conversations