Chocolates
CodeChefOpen on judge ↗
A Child wants to buy N chocolates from the shop. He has to pay K rupees for the first chocolate, 2K rupees for the second one and so on. He has X rupees. How many rupees does he have to borrow from his friend to buy N chocolates? Input The first line contains three positive integers N,K,X. - K - the cost of the first chocolate - X - initial amount of rupees the child have - N - the number
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