This post is all about the solution of the "B. Death's Blessing" Educational Codeforces Round 138 (Rated for Div. 2) Problem Statement.

Codeforces logo

Codeforces




Problem Statement :

You're engaged inside a computer game. You must kill a large swarm of beasts to advance to the next level. There really are n baddies in this swarm, numbered from 1 to n, trying to stand in a row. The i-th creature has ai wellbeing and is equipped with a special "Death's Compliment" spell of power bi.

You're going to slaughter people all one at a time. Killing a monstrosity with wellness h literally takes h secs.

Whenever the i-th monstrous dies, it casts a spell that tends to increase the health of its neighbours by bi (the monsters on places j1 and j+1 are the neighbours of the j-th monster in the row). The initial and final monsters each only have one friend).




Format of Input :

The contribution includes one line with a solitary numeric m (1m105), the highest allowable significance of y.

Format of the Output :

Publish one numeric value for every test case — the shortest possible time taken to kill all beasts.


Also Check this out:-


A. Cowardly Rooks Educational Codeforces Round 138 (Rated for Div. 2) Problem Solution Click Here

C. Number Game Educational Codeforces Round 138 (Rated for Div. 2) Problem Solution Click Here

D. Counting Arrays Educational Codeforces Round 138 (Rated for Div. 2) Problem Solution Click Here

Also Read :- Top Programming Languages of 2022 Click Here

Solution of the Problem: Click Here