← All problemsSign in

Wishcraft

CodeChefRating 2105Open on judge ↗

*Magic is really very simple, all you’ve got to do is want something and then let yourself have it.* Chadda and his Wizard friend PSC were exploring the enchanted forest on Halloween, when Chadda stumbled upon an array $A$ of $N$ magical numbers which took him into a different world. Chadda remembered that PSC gave him two integers $P$ and $Q$ for such a situation. Using these integers, Chadd

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start