Logo
(追記) (追記ここまで)

26330번 - Jumping Frog 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB25201777.273%

문제

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: Suppose the frog is located at the coordinate (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)

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.

입력

The first input line contains an integer, n (1 ≤ n ≤ 100), indicating 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.

출력

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.

제한

예제 입력 1

3
-6 8 17 25
13 17 -16 11
0 0 5 6

예제 출력 1

0
1
0

힌트

출처

University > University of Central Florida > 2013 Local Programming Contest 5번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /