Andrew and the Meatballs again
Andrew likes meatballs very much as you know. He has N plates of meatballs, here the ith plate contains exactly i meatballs. Andrew wants to take exactly K plates to his trip to Las Vegas. On this occasion, he wants to choose the K plates by a strange way: if both ith and jth plates are chosen, then i and j must not be relative prime, for all 1 ≤ i . Please help him to choose K plates. Output o
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