-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2113b.cpp
More file actions
39 lines (38 loc) · 816 Bytes
/
2113b.cpp
File metadata and controls
39 lines (38 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <bits/stdc++.h>
using namespace std;
#define NO cout<<"NO\n"
#define YES cout<<"YES\n"
#define F first
#define S second
#define cases int _; cin >> _; while(_--)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef set<int> si;
void solve() {
int w,h,a,b; cin >> w >> h >> a >> b;
int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
bool u = true;
if(x1 < x2) {
x1+=a;
if((x2-x1) % a != 0) {NO; return; }
} else {
x2+=a;
if((x1-x2) % a != 0) {NO; return;}
}
if(y1 < y2) {
y1+=b;
if((y2-y1) % b != 0) {NO; return;}
} else {
y2+=b;
if((y1-y2) % b != 0) {NO; return;}
}
YES; return;
}
int main() {
cases {
solve();
}
return 0;
}