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

题目描述

There are three integers A, B and C written on the blackboard.

You can perform the following two operations as many times as you like:

1. Change B to A-B.
2. Change C to B-C.

Please note that each time you don't need to perform all two operations. You can choose one type of operation to perform.

You are given an integer x. Answer whether you can change C into x using these operations.

You need to answer T queries independently.

输入描述:

The first line contains a positive integer .

Each of the next T lines contains four integers .

输出描述:

For each test case, output "Yes" if C can become x, and "No" otherwise (without quotes).
示例1

输入

复制
3 
2 4 3 1 
2 4 3 2 
4 2 2 0

输出

复制
Yes
No
Yes

说明

Please note that A, B, C, x could be negative.

备注:

Please note that A, B, C, x could be negative.