-->
当前位置:首页 > 题库

PROGRAMMING:Jumping Frog

Luz5年前 (2021-05-10)题库478
A frog is located at the coordinate (x1,y1). He wants to go to the coordinate (x2,y2). He will perform one or more jumps to reach his destination. The rule of the jumping is as follows:
The frog is at the coordinates (x1, Y1), he wants to go to the coordinates (X2, Y2), he will make one or more jumps to reach the destination. The jumping rules are as follows:
Suppose the frog is located at the coordinate (x,y); then he can jump to the following foursquares:
Suppose the frog is at coordinates (x, y); Then he can jump to the following four squares:
1. (x+y,y)
2. (x-y,y)
3. (x,y+x)
4. (x,y-x)
The problem:
Given the coordinates (x1,y1) and (x2,y2), you need to determine if it is possible for the frog to travel from (x1,y1) to (x2,y2) through a series of jumps as described.
Given the coordinates (x1, Y1) and (X2, Y2), you need to determine if it is possible for the frog to move from (x1, Y1) to (X2, Y2) by a series of jumps.
### **The Input**:
The first input line contains an integer, n (1 ≤ n ≤ 100), indicating the number of test cases.
The first input line contains an integer n (1 ≤ n ≤ 100) representing the number of test cases.
Each test case consists of four integers (between -1,000,000,000 to +1,000,000,000 inclusive) separated by a single space denoting x1, y1, x2 and y2, respectively.
Each test case consists of four integers (from - 1000000000 to + 1000000000) separated by a single space, representing x1, Y1, X2 and Y2 respectively.
### **The Output**:
For each test case, output 1 if the frog can travel from (x1,y1) to (x2,y2) through a series of jumps as described or 0 otherwise.
For each test case, if the frog can move from (x1, Y1) to (X2, Y2) by describing a series of jumps, output 1, otherwise output 0.
### **Sample Input:**
```in
three
-6 8 17 25
13 17 -16 11
0 0 5 6
```
### **Sample Output:**
```out
0
one
0
```







answer:If there is no answer, please comment