## [ equations in integers ] Decompositions and partitions $\quad]$ [ GCD and LCM. Mutual simplicity ]

Ostap Bender organized a giveaway of elephants to the population in the city of Fux. 28 union members and 37 non-members showed up for the giveaway, and Ostap distributed the elephants equally among all union members and equally among non-members.

It turned out that there was only one way to distribute the elephants (so that all elephants were distributed). What is the maximum number of elephants that Ostap Bender could have had? (It is assumed that each person who came received at least one elephant.)
Let Bender somehow distributed elephants between two specified groups. To implement another way of distribution, he would have to take away an equal number of elephants from each member of one group and distribute them equally among the members of the other group. Therefore, the total number of elephants transferred from one group to the other is a multiple of both 37 and 28. These numbers are coprime, so the specified number of elephants is a multiple of \(28 \cdot 37 = 1036\).

If the total number of elephants is greater than \(2 \cdot 1036 = 2072\), then at least one group has more than 1036 elephants, and they can be selected and distributed to the members of the other group. If, however, the total number of elephants is 2072, then by distributing 1036 elephants to each group (in this case, union members receive 37 elephants each, and non-members receive 28 elephants each), we will implement the only possible distribution: it is impossible to take away all the elephants from either group.

## Answer

2072 elephants.