Naman and Sum
CodeChefOpen on judge ↗
Naman wants to go to play but only after he solves the challenge given to him by his friend Raghav. Now Raghav gives Naman an array $A$ of length $N$ and a number $S$. Again he provides Naman with a positive integer $k$. Raghav wants that the sum of elements of the array to be atleast equal to $S$ which he can do by adding elements to the array of values not greater than $k$. Raghav wants Naman to
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