欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

codeforces 1260 B. Obtain Two Zeroes

程序员文章站 2022-06-02 11:49:48
...

codeforces 1260 B. Obtain Two Zeroes
分析:
codeforces 1260 B. Obtain Two Zeroes

#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<iostream>
#define ll long long 
using namespace std;

ll a,b;

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		ll aa,bb;
		cin>>aa>>bb;
		a=max(aa,bb);
		b=min(aa,bb);
		int ok;
		if(a<=2*b)
		{
			if((a+b)%3==0)
				ok=1;
			else
				ok=0;
		}
		else
			ok=0;
		if(ok==0)
			cout<<"NO\n";
		else
			cout<<"YES\n";
	}
	return 0;
}
相关标签: math