← All problemsSign in

Beauty in Everything

CodeChefRating 1969Open on judge ↗

A binary string $B$ of length $N$ is called *good*, if there exists an integer $K$ satisfying the following properties: - $1 \lt K \lt N$ - $K$ divides $N$ - Consider a binary grid $G$ of dimensions $(\frac{N}{K} \times K)$, such that its row-major order equals $B$ - that is, for each $1 \leq i \leq \frac{N}{K}$ and $1 \leq j \le K$, we must have $G_{i, j} = B_{(i-1)\cdot K + j}$. Every column

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