#codeforcesP2009C. The Legend of Freya the Frog

The Legend of Freya the Frog

Problem

Freya the Frog is traveling on the 2D coordinate plane. She is currently at point (0,0)(0,0) and wants to go to point (x,y)(x,y). In one move, she chooses an integer dd such that 0dk0≤d≤k and jumps dd spots forward in the direction she is facing.

Initially, she is facing the positive xx direction. After every move, she will alternate between facing the positive xx direction and the positive yy direction (i.e., she will face the positive yy direction on her second move, the positive xx direction on her third move, and so on).

What is the minimum amount of moves she must perform to land on point (x,y)?(x,y)?

Input

The first line contains an integer t(1t104)t(1≤t≤10^4 ) — the number of test cases.

Each test case contains three integers x,y,x, y, and k(0x,y109,1k109).k (0≤x,y≤10^9,1≤k≤10^9).

Output

For each test case, output the number of jumps Freya needs to make on a new line.

Example : in

3
9 11 3
0 10 8
1000000 100000 10

Example : out

8
4
199999

Note

In the first sample, one optimal set of moves is if Freya jumps in the following way: $(0,0 ) →(2,0) →(2,2) →(3,2) →(3,5) →(6,5) →(6,8) →(9,8) →(9,11)$. This takes 88 jumps.