mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 18:52:02 +00:00
P1170 兔八哥与猎人
R40527181
This commit is contained in:
parent
9575e7d641
commit
f1193a1568
21
problem/P1170/P1170.cpp
Normal file
21
problem/P1170/P1170.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include<bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int gcd(int a, int b) {
|
||||
if(b == 0) {
|
||||
return a;
|
||||
}
|
||||
return gcd(b, a%b);
|
||||
}
|
||||
|
||||
int main() {
|
||||
int t;
|
||||
cin >> t;
|
||||
while(t--) {
|
||||
int ax, ay, bx, by;
|
||||
cin >> ax >> ay >> bx >> by;
|
||||
cout << (gcd(abs(ax-bx), abs(ay-by)) == 1 ? "no" : "yes") << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user