You're given red blocks and green blocks where g. A tower of height uses exactly blocks total.
You want the tallest tower possible. Find the largest where . Let . The remaining blocks go unused. You don't need to use all blocks. Understanding the problem structure is half the battle.