Magical Bullets
CodeChefOpen on judge ↗
Chef is planning to eliminate the ghosts from his house with the help of some magical bullets he has. Each bullet has some power level $P_i$. A ghost can sometimes destroy the magical bullets if it possesses any of the skill S in the range 2 to K (both inclusive) such that S is a factor of $P_i$. Given the set of guns (the power of the guns), Chef is having and chef wants to pick only those guns
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