← All problemsSign in

Problem-1

Plum wants to buy video games with her pocket money. The video game store has an offer. The cost of the first game is ‘p’, and every subsequent game will cost ‘i’ less than the previous one. After the cost is equal to ‘m’, every game will cost the same (m). If Plum’s pocket money is given as input, output the number of games she can buy. Input: The first and only line contains 4 integers - p

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