Educational Codeforces Round 77 (Rated for Div. 2) B. Obtain Two Zeroes
Posted c4lnn
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Educational Codeforces Round 77 (Rated for Div. 2) B. Obtain Two Zeroes相关的知识,希望对你有一定的参考价值。
题目:https://codeforces.com/contest/1260/problem/B
思路:易得成立的条件为:((a+b)mod3==0) && (max(a,b)le min(a,b)*2)
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int T;cin>>T;
while(T--)
{
int a,b;
cin>>a>>b;
if((a+b)%3==0&&max(a,b)<=min(a,b)*2) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
以上是关于Educational Codeforces Round 77 (Rated for Div. 2) B. Obtain Two Zeroes的主要内容,如果未能解决你的问题,请参考以下文章
Educational Codeforces Round 7 A
Educational Codeforces Round 7
Educational Codeforces Round 90
Educational Codeforces Round 33