1 Star 0 Fork 0

ShawnBox / OI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
HYSBZ - 2299.cpp 472 Bytes
一键复制 编辑 原始数据 按行查看 历史
ShawnBox 提交于 2018-09-03 16:07 . 2018/9/3-16:07
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
ll a,b,x,y,d;
ll gcd(ll p,ll q){return !q?p:gcd(q,p%q);}
bool check(ll p,ll q){
return p%d==0&&q%d==0;
}
int main(){
int T;
scanf("%d",&T);
while(T--){
scanf("%lld%lld%lld%lld",&a,&b,&x,&y);
d=gcd(2*a,2*b);
if(check(x,y)||check(x+a,y+b)||check(x+b,y+a)||check(x+a+b,y+a+b))
puts("Y");
else puts("N");
}
}
C++
1
https://gitee.com/ShawnBox/OI.git
git@gitee.com:ShawnBox/OI.git
ShawnBox
OI
OI
master

搜索帮助