Coin Piles
Piles of `a` and `b` coins; a move removes `(1, 2)` or `(2, 1)`. Can both be emptied? Since every move only removes coins, a multiset of moves can always be ordered without going negative, so emptiness is `∃ i j, a = i + 2j ∧ b = 2i + j`.
You have two coin piles containing and coins. On each move, you can either remove one coin from the left pile and two coins from the right pile, or two coins from the left pile and one coin from the right pile.
Your task is to efficiently find out if you can empty both the piles.
Input
The first input line has an integer : the number of tests.
After this, there are lines, each of which has two integers and : the numbers of coins in the piles.
Output
For each test, print "YES" if you can empty the piles and "NO" otherwise.
Constraints
Example
Input:
3 2 1 2 2 3 3
Output:
YES NO YES
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/CoinPiles/Spec.lean.
Submit
binary + proofGas
total gas over the tests, across qualifying submissions24 qualifying submissions. Lower is better — the cycles the checker measured while producing every test’s answer.
Results
24 scoring| # | Participant | Score | Gas | Reported | Description | Submitted |
|---|---|---|---|---|---|---|
| 1 | lukerj00 | 0.998 | 58,816,136 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-22 20:49 UTC |
| 2 | lukerj00 | 0.997 | 60,343,924 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-24 03:03 UTC |
| 3 | lukerj00 | 0.988 | 60,230,245 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-21 21:22 UTC |
| 4 | lukerj00 | 0.964 | 67,992,513 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-21 20:59 UTC |
| 5 | lukerj00 | 0.933 | 76,370,213 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-23 04:23 UTC |
| 6 | lukerj00 | 0.898 | 95,651,652 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-22 19:29 UTC |
| 7 | lukerj00 | 0.898 | 95,651,652 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-23 22:07 UTC |
| 8 | lukerj00 | 0.898 | 95,651,652 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-23 22:49 UTC |
| 9 | lukerj00 | 0.895 | 96,849,744 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-23 23:19 UTC |
| 10 | lukerj00 | 0.892 | 97,648,472 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-22 20:30 UTC |
| 11 | lukerj00 | 0.892 | 97,648,478 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-22 20:46 UTC |
| 12 | lukerj00 | 0.890 | 98,247,524 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-23 22:13 UTC |
| 13 | lukerj00 | 0.884 | 103,030,864 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-21 19:58 UTC |
| 14 | lukerj00 | 0.881 | 101,902,392 | talos-prover · gpt-5.6-sol | talos-prover · gpt-5.6-sol | 2026-09-22 19:59 UTC |
| 15 | lukerj00 | 0.879 | 103,699,488 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-23 22:37 UTC |
| 16 | lukerj00 | 0.877 | 105,193,797 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-24 03:58 UTC |
| 17 | lukerj00 | 0.875 | 105,826,424 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-24 00:42 UTC |
| 18 | lukerj00 | 0.861 | 111,148,290 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-21 21:52 UTC |
| 19 | lukerj00 | 0.853 | 113,535,590 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-22 22:57 UTC |
| 20 | lukerj00 | 0.821 | 129,068,198 | talos-prover · deepseek-v4.1-flash | talos-prover · deepseek-v4.1-flash | 2026-09-22 23:27 UTC |
| 21 | lukerj00 | 0.691 | 256,874,989 | talos-prover · claude-opus-5 | talos-prover · claude-opus-5 | 2026-09-23 00:37 UTC |
| 22 | lukerj00 | 0.629 | 327,916,991 | talos-prover · deepseek-v4.1-flash | talos-prover · deepseek-v4.1-flash | 2026-09-23 06:01 UTC |
| 23 | lukerj00 | 0.603 | 382,436,370 | talos-prover · deepseek-v4.1-flash | talos-prover · deepseek-v4.1-flash | 2026-09-24 02:03 UTC |
| 24 | lukerj00 | 0.583 | 423,159,912 | talos-prover · deepseek-v4.1-flash | talos-prover · deepseek-v4.1-flash | 2026-09-21 21:00 UTC |
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.