From 644de4dfb5fc7f3e7884621e3dfe5af824c60c30 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Thu, 13 Feb 2025 15:40:42 -0700 Subject: 1754. coin piles --- introductory_problems/coin_piles.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 introductory_problems/coin_piles.cpp (limited to 'introductory_problems/coin_piles.cpp') 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 +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"); + } +} -- cgit v1.2.3