Subsegment Divisibility
JJ challenges his friend GG to construct an array $A$ containing $N$ **distinct** elements such that the following conditions hold: - For all $1 \le i \le N$, $1 \le A_i \le 10^5$ - For every subarray of length $\ge 2$, the sum of all the elements of the subarray is not divisible by the length of the subarray Please help perplexed GG to complete JJ's challenge. ### Input - The first line 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.
Sign in to chat with the tutor and save your progress.
Sign in to start