CF 106479A - Подарок другу

The statement for Codeforces 106479A - “Подарок другу” isn’t included in your prompt, so I don’t have enough information to reconstruct the problem reliably.

CF 106479A - \u041f\u043e\u0434\u0430\u0440\u043e\u043a \u0434\u0440\u0443\u0433\u0443

Rating: -
Tags: -
Solve time: 29s
Verified: no

Solution

The statement for Codeforces 106479A - “Подарок другу” isn’t included in your prompt, so I don’t have enough information to reconstruct the problem reliably.

Since this is an editorial request, I need at least the actual problem description (or a link / paraphrase of it) to avoid guessing the task incorrectly. Gym problems in particular often have similar names but very different mechanics, so inferring would likely produce a wrong solution and misleading explanation.

If you paste the statement, even in Russian, I can immediately produce the full Codeforces-style editorial in the exact format you requested.