// compile: g++ -o data data.cpp -std=gnu++20 -DLOCAL
// run: ./data < data.in
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#ifdef LOCAL
#endif
#define sz(v) ((int)(v).size())
#define PV(v) for (int i=0;i<v.size();++i)cout<<v[i]<<" ";cout<<endl;
#define INTINF 9223372036854775807
#define int long long
using namespace std;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int _; cin >> _;
while (_--) {
int a, b; cin >> a >> b;
if (max(a, b) > min(a, b) * 2) {
cout << "NO" << endl;
continue;
}
if ((a + b) % 3 != 0) {
cout << "NO" << endl;
continue;
}
cout << "YES" << endl;
}
return 0;
}
No Comments