Problem

Source: Olimphíada 2023 - Problem 3/Level 2, 3, U

Tags: combinatorics, Operation, algorithm



Let $n$ be a positive integer. On a blackboard is a circle, and around it $n$ non-negative integers are written. Raphinha plays a game in which an operation consists of erasing a number $a$ neighboring $b$ and $c$, with $b \geq c$, and writing in its place $b + c$ if $b + c \leq 5a/4$ and $b - c$ otherwise. Your goal is to make all the numbers on the board equal $0$. Find all $n$ such that Raphinha always manages to reach her goal.