Fedor Popov's submission of Perfection | CodeChef