Company: Trilogy_27july
Difficulty: medium
Mario's Adventure Problem Description A river runs across Mario's path. The river is A units wide, and its cells are numbered 1 to A from left to right. Mario starts on the solid bank at cell 0 and wants to reach the solid bank at cell A + 1 . Cells 0 and A + 1 are always safe to stand on; every cell of the river itself is water. Floating on the river are M wooden platforms. Platform i covers C[i] consecutive cells. Before Mario sets off he may slide the platforms along the river, but he may not reorder them and he may not let two of them overlap: platform 1 must stay to the left of platform 2 , which must stay to the left of platform 3 , and so on. Every platform must lie entirely inside cells 1 to A . Consecutive platforms may be left touching or separated by any number of empty cells. Once the platforms are fixed, Mario travels by jumping. From the cell he is standing on he may jump to any cell whose distance from it is at most B , in either direction, and he may only land on cell 0