Credit for this problem goes to the 51st IMO, problem 5. Thanks!

Coin Towers

In each of six boxes , , , , , there is initially one coin. There are two types of operation allowed:

Type 1: Choose a nonempty box with . Remove one coin from and add two coins to .

Type 2: Choose a nonempty box with . Remove one coin from and exchange the contents of (possibly empty) boxes and .

Warm up problem: Using only operations of Type 1, what’s the most coins you can have in total across all 6 boxes?

Main problem: Using operations of either type, what’s the most coins you can have in total across all 6 boxes?

Solution