summaryrefslogtreecommitdiff
path: root/introductory_problems/coin_piles.cpp
blob: 2d00cc67118964bd7b23dd2d0696f409c0a0cbc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 1754. Coin Piles
#include <bits/stdc++.h>
using namespace std;

int main() {
  static int t, a, b;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    scanf("%d %d", &a, &b);
    printf((((a + b) % 3) != 0 || a > 2 * b || b > 2 * a) ? "NO\n" : "YES\n");
  }
}