2017 Polish Junior Math Olympiad Finals P5
Source: 2017 Polish Junior Math Olympiad Finals
May 22, 2023
combinatorics
Problem Statement
There are matches lying on a table, forming one-match piles. Adam wants to combine them into a single pile of matches. He will do this using operations, each of which consists of combining two piles into one. Adam has made a deal with Bartek that every time he combines a pile of matches with a pile of matches, he will receive candies from Bartek. What is the greatest number of candies that Adam can receive after performing operations? Justify your answer.