← All problemsSign in

Easy Permutation

CodeChefRating 1057Open on judge ↗

You are given an integer $N$. Construct any permutation $A$ of $N$ integers such that the value $LCM(1 + A_1 , 2 + A_2, \ldots, N + A_N)$ is **minimised**. Note: - $LCM$ denotes the [least common multiple](https://en.wikipedia.org/wiki/Least_common_multiple) of the integers. - A permutation of $N$ integers contains all integers from $1$ to $N$ exactly once. ### Input - First line will contain

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