diff options
Diffstat (limited to 'introductory_problems/coin_piles.cpp')
-rw-r--r-- | introductory_problems/coin_piles.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/introductory_problems/coin_piles.cpp b/introductory_problems/coin_piles.cpp new file mode 100644 index 0000000..2d00cc6 --- /dev/null +++ b/introductory_problems/coin_piles.cpp @@ -0,0 +1,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"); + } +} |