← All problemsSign in

Presents for Cheffina

CodeChefRating 757Open on judge ↗

Chef has fallen in love with Cheffina, and wants to buy $N$ gifts for her. On reaching the gift shop, Chef got to know the following two things: - The cost of each gift is $1$ coin. - On the purchase of every $4^{th}$ gift, Chef gets the $5^{th}$ gift free of cost. What is the minimum number of coins that Chef will require in order to come out of the shop carrying $N$ gifts? ### Input - The fir

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