Bags and Balls
CodeChefOpen on judge ↗
You are given $N$ empty bags. Provided with $K$ numbers of balls you have to put those balls in the bags. Also, you have to put the balls in a sequence i.e. given a number $R$, the balls you put in the bags should be in increasing multiples of $R$. For example, if R=5 then the balls in the bags are in sequence 5,10,15,20... Now your task is to find how many bags remain empty. - Note: The balls in
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