MathDB
2017 Polish Junior Math Olympiad Finals P5

Source: 2017 Polish Junior Math Olympiad Finals

May 22, 2023
combinatorics

Problem Statement

There are nn matches lying on a table, forming nn one-match piles. Adam wants to combine them into a single pile of nn matches. He will do this using n1n-1 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 aa matches with a pile of bb matches, he will receive aba\cdot b candies from Bartek. What is the greatest number of candies that Adam can receive after performing n1n-1 operations? Justify your answer.