summaryrefslogtreecommitdiff
path: root/introductory_problems/coin_piles.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-02-13 15:40:42 -0700
committerJack Sangdahl <[email protected]>2025-02-13 15:40:42 -0700
commit644de4dfb5fc7f3e7884621e3dfe5af824c60c30 (patch)
treec705aafea36bd0201a7cf3381c7fd7f111d2e6d5 /introductory_problems/coin_piles.cpp
parentd5c06c689e3328546cd4c486b30a7909651501ed (diff)
downloadcses-644de4dfb5fc7f3e7884621e3dfe5af824c60c30.tar.gz
cses-644de4dfb5fc7f3e7884621e3dfe5af824c60c30.zip
1754. coin piles
Diffstat (limited to 'introductory_problems/coin_piles.cpp')
-rw-r--r--introductory_problems/coin_piles.cpp12
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");
+ }
+}