MathDB
Vending machine

Source: Russian TST 2021, Day 7 P1

March 21, 2023
combinatoricsnumber theory

Problem Statement

A machine accepts coins of kk{} values 1=a1<<ak1 = a_1 <\cdots < a_k and sells kk{} different drinks with prices 0<b1<<bk0<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 (a1,,ak;b1,,bk)(a_1,\ldots,a_k;b_1,\ldots,b_k) does this property hold?