← All problemsSign in

Peter Piper_s Messy Room

There are N objects thrown hither and tither in a room. Each object has a random number R painted on it. Peter arranges all the boxes in decreasing order and wishes to know the numbers at all prime positions and their sum. He has many rooms with such boxes. So he wishes to write an algorithm to do the arranging and fulfill his wish for rest of the rooms.. Input The first line contains an inte

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