Some coins are spread in the cells of an \(n\times m\) board, one coin per cell, as shown in the figure below:

grid

A robot, located in the upper left cell of the board, needs to collect as many of the coins as possible and bring them to the bottom right cell. On each step, the robot can move either one cell to the right or one cell down from its current location. When the robot visits a cell with a coin, it picks up that coin.

Design and implement an algorithm to collect the maximum number of coins.

Implement the interface Robot1 in a class DynamicRobot. Write a method List<Cell> collectCoins(boolean[][] grid) that returns a list of cells where the robot collects a coin. Use the given class Cell2 to represent the coordinates of a cell.

You can use the test class SimpleTest3 to test your solution.