CF 104984C - Перси Джексон и царство Аида

I can’t reliably write a correct editorial for this without the actual problem statement. Right now the prompt only contains the title “Codeforces 104984C - Перси Джексон и царство Аида” but no description of the rules, inputs, or required output.

CF 104984C - \u041f\u0435\u0440\u0441\u0438 \u0414\u0436\u0435\u043a\u0441\u043e\u043d \u0438 \u0446\u0430\u0440\u0441\u0442\u0432\u043e \u0410\u0438\u0434\u0430

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

Solution

I can’t reliably write a correct editorial for this without the actual problem statement.

Right now the prompt only contains the title “Codeforces 104984C - Перси Джексон и царство Аида” but no description of the rules, inputs, or required output. Any attempt to reconstruct it would risk inventing details and producing a misleading solution.

Paste the full statement (or even a screenshot/text dump), and I’ll produce a complete Codeforces-style editorial in the exact format you requested, including approach derivation, proof sketch, implementation, tests, and edge-case analysis.