← All problemsSign in

Good Array

You have been given an integer $N$. An array$(arr)$ is said to be good if its array value is found equal to $N$. **Array value** = $\sum f(arr[i])$ Here, $f(x)$ is equal to number of integers $k$ $(1 \leq k \leq x)$ which gives $GCD(k,x)=1$ Print the good array to solve this task. **Note that elements of array should be less than or equal to 1000000 (and greater than 0) and sho

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