You're in an imaginary city where Bugs Bunny, the rabbit lives. Bugs needs to navigate through a row of N cells in the city, where each cell can either be a rabbit hole (Bugs can enter it) or an obstacle that he can't jump into.
Your mission is to guide Bugs through the city successfully. Bugs starts by hopping into the xth cell from the beginning, then jumps to x+yth cell, then jumps to x+2∗yth cell and so on until he reaches a cell beyond the last one. If any of these cells is an obstacle, Bugs can't proceed.
To help Bugs on his adventure, you can modify the city layout with two actions:
Your challenge is to calculate the minimum cost in coins required to modify the city layout, ensuring that Bugs Bunny can follow the given x and y pattern.
Input Format:
Output Format:
Constraints