Playthrough all bets
CodeChefOpen on judge ↗
Krish wanted to bet on N events. The (i+1)th event starts after the ith event is finished. In each ith event, Krish would stake amount Ai and in return get amount Bi (0 i i). Krish doesn't know the future. So, help him find out the minimum initial amount he should have so that he can playthrough all the N bets. Input The first line of the input contains an integer N denoting the number of eve
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