Ritisha's Way Home


Submit solution

Points: 1
Time limit: 1.5s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python, Rust

It is 2:00 AM, and Ritisha is ready to leave the Duck Lounge and head home. Fortunately, the city is arranged as a grid, and a rideshare car is waiting for her.

The Duck Lounge is at the intersection (x_s,y_s), and Ritisha's home is at (x_h,y_h). During each minute, the car can move at most a blocks horizontally and at most b blocks vertically. These movements happen at the same time.

More precisely, in one minute the car may change its x-coordinate by any integer between -a and a, and its y-coordinate by any integer between -b and b. The car must remain at intersections with integer coordinates. There are no obstacles or one-way streets.

Find the minimum number of minutes Ritisha needs to reach home.

Input

The first line contains four integers x_s, y_s, x_h, and y_h (-10^9 \leq x_s,y_s,x_h,y_h \leq 10^9): the coordinates of the Duck Lounge and Ritisha's home.

The second line contains two integers a and b (1 \leq a,b \leq 10^9): the maximum horizontal and vertical distances the car can travel in one minute.

Output

Output a single integer: the minimum number of minutes Ritisha needs to reach home.

Examples

Input 1
11 8 2 3
4 2
Output 1
3

The car must travel 9 blocks horizontally and 5 blocks vertically. It can travel 4 blocks horizontally per minute, and 2 vertically per minute. After 3 minutes, it can reach Ritisha's home.

Input 2
-5 12 8 -2
6 4
Output 2
4

Comments

There are no comments at the moment.