Ankur and Coins
CodeChefOpen on judge ↗
Ankur has two boxes containing infinite number of coins of Re 1 and Rs 2 respectively. He is interested to purchase an item that cost Rs X. So, he took some coins from the first box and some coins from the 2nd finally he is able to obtain the total amount as Rs X from the coins. i.e. Suppose number of Re 1 coins =p and number of RS. 2 coins = q. Then X= p+ 2q; Find out the total number of way
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