Cocktail With Pony
题号:NC222157
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

There is a cute pony! Oh No, why a wolf chasing it behind?

In a one-dimensional number axis, the wolf initial position is point x_1, and the pony at point x_2 initially. Each round, the wolf must move v_1 steps, the pony must move v_2 steps. Each step can move one point to the left or right.
Now the pony and the wolf take turns to move. The pony moves first in the first round, then the wolf moves in the second round, and so on.
Means, the pony moves in the rounds, and the wolf moves in the rounds.
If at a certain moment, the wolf and the pony stand in the same position, it means that the wolf has caught the pony. This moment can be in the process of moving.
It is guaranteed that at the beginning, the little pony and the wolf are not in the same point.

The pony wants to delay the rounds he be caught as many as possible, while the wolf hopes to catch the pony earlier. If both the wolf and the little pony are smart enough, in the first few rounds, will the wolf catch the little pony?

Note: During the movement of the wolf or the little horse, they cannot exceed the boundary of the number axis, that is, any position  they move to must satisfy

输入描述:

The first line of input contains a positive integer , which represents the number of test cases.

Each test contains five positive integers and guarantee .The meaning is as shown in the statement.

输出描述:

For each test data, output a positive integer in one line to indicate that the wolf needs several rounds to catch the pony. 
示例1

输入

复制
1
10 3 1 4 8

输出

复制
4

说明

The pony moves to position {9} in the first round, and the wolf moves to position {7} in the second round. In the third round, the little pony must move, so it can only move to position {8} or {10}. No matter which position it is, the wolf can catch up in the fourth round. So output {4}.