Prime Pattern
CodeChefOpen on judge ↗
### Problem Description: Shristi loves patterns. Recently, she came across with prime patterns. She got $N$ number of balls marked with 0 to $N$-1, of which exactly $M$ balls are red. She wants to arrange these balls in such a way that Red balls are placed exactly on the PRIME PLACES and all the PRIME PLACES should be filled only by the red balls. PRIME PLACE is the place which has a sequential
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