← All problemsSign in

Make It One

CodeChefRating 1886Open on judge ↗

You're given two positive integers $L$ and $R$ ($L \lt R$). Let $N = R-L+1$. Consider the array $A = [L, L+1, L+2, \ldots, R]$ of length $N$ that contains every integer from $L$ to $R$ exactly once, in order. Find *any* array $B$ of length $N$ such that: - Every integer from $L$ to $R$ appears exactly once in $B$; and - For each $1 \leq i \leq N$, $\gcd(A_i, B_i) = 1$. If no such $B$ exists,

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