← All problemsSign in

Spliting Balls

CodeChefRating 1435Open on judge ↗

There are $N$ balls in a bag. Initially, the $i^{th}$ ball has a number $A_i$ on it. In one second, a ball with number $k$ $(k>1)$, dissociates into $k$ balls, where each of the $k$ balls has number $(k-1)$ written on it. If $k = 1$, there is no change on the state of the ball. Find the number of balls in the bag after $10^{100}$ seconds. Since the final number of balls can be huge, output

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