Problem

Source: Russian TST 2021, Day 7 P1

Tags: combinatorics, number theory



A machine accepts coins of $k{}$ values $1 = a_1 <\cdots < a_k$ and sells $k{}$ different drinks with prices $0<b_1 < \cdots < b_k$. It is known that if we start inserting coins into the machine in an arbitrary way, sooner or later the total value of the coins will be equal to the price of a drink. For which sets of numbers $(a_1,\ldots,a_k;b_1,\ldots,b_k)$ does this property hold?