Skip to main content
OlympiadHQ

Browse · MathNet

Print

Saudi Arabian IMO Booklet

Saudi Arabia number theory

Problem

You plan to organize your birthday party, which will be attended either by exactly persons or by exactly persons (you are not sure at the moment). You have a big birthday cake and you want to divide it into several parts (not necessarily equal), so that you are able to distribute the whole cake among the people attending the party with everybody getting cake of equal mass (however, one may get one big slice, while others several small slices - the sizes of slices may differ). What is the minimal number of parts you need to divide the cake, so that it is possible, regardless of the number of guests.
Solution
We claim that the answer is . Firstly, note that if we consider the cake as the interval and make cuts at points with coordinates () and (), then we will be able to satisfy the condition of the problem. Moreover, there will be cuts with , cuts with , of which coincide. Therefore we will have cuts, so parts. Let us show that this estimate is sharp. For that purpose, consider a bipartite graph, with the vertices of one side corresponding to the persons on the party, and the vertices of the other side corresponding to the persons on the party. We connect the vertices and by an edge, corresponding to the piece of cake, if the piece of cake will be given to the person , if exactly persons attend, and to the person , if exactly persons attend. Consider a component of connectivity of the graph. Then, if it contains edges in one side and edges in the other side, then the edges of it correspond to a cake with weight . Therefore, . Thus, the number of components of connectivity is at most . The graph has vertices and at most components of connectivity, so the number of edges is at least (the equality is obtained, when each of the components is a tree).
Final answer
m + n - gcd(m, n)

Techniques

Greatest common divisors (gcd)Inclusion-exclusionEuler characteristic: V-E+F