Simply put, we can think of the game's map as a flat grid of infinite length and width, and there are only two kinds of things that can be placed on the grid: ``stone`` and ``water``. We refer to ``a 1x1 grid`` in the grid as ``one grid``.Each grid can be built by placing a stone block that can be placed anywhere . Once the stone is placed, it is fixed and does not change position.Water is special, similar to real-world water, Terraria's water will naturally flow downward, left and right when placed, and if it encounters a stone, it will stop flowing in that direction. For example, in the following figure, the same three stones, the left side of the placement can use a fixed block of water, and the right stone can not retain any water, the water will flow down to the right.Vega decided to build an aerial lake containing at least. m of water for fishing. He currently has a total of. n stones, please output as much water as he can fix, otherwise, output at least how many stones can fix at least
Terraria is a 2D action-adventure, open-world sandbox game. Simply put, we can think of the game's map as a flat grid of infinite length and width, and there are only two kinds of things that can be placed on the grid: ``stone`` and ``water``. We refer to ``a 1x1 grid`` in the grid as ``one grid``. Each grid can be built by placing a stone block that can be placed anywhere (allowing for hanging in the air, i.e. not requiring a block under each block). Once the stone is placed, it is fixed and does not change position. Water is special, similar to real-world water, Terraria's water will naturally flow downward, left and right when placed, and if it encounters a stone, it will stop flowing in that direction. For example, in the following figure, the same three stones, the left side of the placement can use a fixed block of water, and the right stone can not retain any water, the water will flow down to the right. Vega decided to build an aerial lake containing at least m m of water for fishing. He currently has a total of n n of stones to use. If he can fix at least m m of water with these n n stones, please output as much water as he can fix, otherwise, output at least how many stones can fix at least m m water .