← All problemsSign in

Chefs Birthday

Chef’s birthday is coming up and as you are his best friend you want to give him lots of gifts. You already have $N$ gifts with prices {$p1,p2,p3,…...pn$} . But due to following reasons you can't give him all the $N$ gifts. If $N$>1 and $gcd$ of their prices = 1 ( i.e gcd ( p1, p2 , p3 …. pn ) = 1). However, you also want to maximize the number of gifts as chef is your best friend. So yo

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