Limits: 1s, 128 MB

In the 1970-80s, students in the Soviet Union had to face quite a hurdle. The administrators of selection exams of the Mathematics Department of Moscow State University, the most prestigious mathematics school in Russia, wanted to keep certain individuals from qualifying. Consequently, they came up with the idea of giving them selection exams that contained impossibly hard problems. Any student who failed to answer could be easily rejected, so this system was an effective method of controlling admissions. But these problems were not just difficult, they were carefully designed to have extremely simple solution. Yes, quite the contradiction! But bear with me. As you can imagine, it was not uncommon for students to protest and accuse the administrators of giving impossibly hard problems. In order to silence these protests, the administrators made sure that once the solutions were presented to them, they would seem foolisly simple. But of course while the solutions were simple, the journey to those said solutions were anything but. These problems were known as Coffins, which is a literal translation from the Russian word “Groby”. Let’s focus on one of such problems today.

This is a companion discussion topic for the original entry at