← All problemsSign in

Magic Mirror

CodeChefRating 1178Open on judge ↗

A long, long time ago, Chef found a pair of magic mirrors. Naturally, he decided to play around with them to test their capabilities. There are an infinite number of boxes arranged in a line. The boxes are numbered $1, 2, 3, \ldots$ from left to right. Initially, all of these boxes are colored **white**. First, Chef chose two integer positions $X_1$ and $X_2$ such that $1 \le X_1 \lt X_2$, and

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