Under construction

Still being built. Things may change

Toka, the Prankster

Time limit1sMemory limit1024 MB

Summary
Given Toka's step size that shrinks by K each move and Dolldol's fixed step size D, find how many moves Toka needs to reach home uncaught, or -1 if she is caught.
Level

Medium4 of 10

Topics
Math, Simulation
Solved
No attempts yet

Problem

Mischievous provoker Toka once again teased her friend Dolldol today. Dolldol took the bait and started chasing Toka, intent on catching her!

To escape Dolldol safely, Toka must return home and lock the door. Toka is AA away from home, and Dolldol is A+CA + C away from home in the same direction as Toka. The home, Toka, and Dolldol are on a straight line.

Toka moves toward home with all her strength, and each move covers BB. However, Toka is not in good shape, so after each move, the distance she can move next time decreases by KK. If the distance she can move becomes 00 or less, Toka cannot move from her spot anymore.

Dolldol moves DD on each move to catch Toka. Each move takes the same amount of time, and the two move at the same time. Toka is caught only if, after a move, Dolldol is at the same position as Toka, both arrive at home at the same time, or Dolldol passes Toka. However, if they are at the same position when a move starts, that does not count as being caught. Both keep moving until Toka is caught or reaches home. If Toka reaches home before being caught, she can lock the door. Both move in a straight line toward home.

Watching this, you wondered whether Toka could reach home without being caught and survive. Find out whether Toka can reach home safely!

Input

The first line contains integers A(1≤A≤1012)A(1 \le A \le 10^{12}) and B(1≤B≤109)B(1 \le B \le 10^{9}), separated by a space.

The second line contains integers C(0≤C≤1012)C(0 \le C \le 10^{12}) and D(1≤D≤109)D(1 \le D \le 10^{9}), separated by a space.

The third line contains an integer K(0≤K≤B)K(0 \le K \le B).

Output

If Toka reaches home safely, print the number of moves it takes her to get home.

If Dolldol catches Toka while she is moving toward home, print −1-1.

Examples2

  1. Example 1

    Input
    100 50
    10 50
    10
    
    Expected output
    -1
    
  2. Example 2

    Input
    100 50
    10 35
    10
    
    Expected output
    3