MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CSES/Intro/CoinPiles.cc:4–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4int main(){
5 ios_base::sync_with_stdio(false),cin.tie(nullptr);
6
7 int T; cin >> T;
8 while (T--) {
9 int a, b; cin >> a >> b;
10 if(a<b) swap(a,b);
11
12 if (a > 2 * b) {
13 cout << "NO\n";
14 } else if ((a + b) % 3 == 0) {
15 cout << "YES\n";
16 } else {
17 cout << "NO\n";
18 }
19 }
20 return 0;
21}
22

Callers

nothing calls this directly

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected