ROBOT A The bot sucks the dirt in square it is on if any and then moves randomly in any of the 4 direction with equal probabilities. In case if it is on border then direction chosen randomly among the directions left to move. The bot only gets data of dirt in square it is on and boundary on any side of the current square obtained. ROBOT B The bot sucks the dirt in square it is on if any and then moves to the adjacent block with maximum dirt(Greedy Approach). In case if 2 or more adjacent squares have the maximum dirt value, then bot selects randomly out the 'eligible' directions. The bot gets data of dirt in square it is on, the dirt values of adjacent squares and if there is boundary on any side of the current square. ROBOT C The bot knows the dirt value of square it is on currently, the dirt values of adjacent squares and if there is boundary on any side of the current square. Further, it knows about rectangular nature of map. The bot stores the map and dirt value of visited squares and their adjacent squares. For any current position of bot, it considers all points it has knowledge about and then decides the target point it has to go to based on utility function given as ratio of dirt value of point(being considered in race to be the target point) and the distance between that point and source point. (This utility function is considered as it would be beneficial to get to some point say at 3 distance(pair of suck and move is being considered unit distance here) with dirt value more than 3 times the dirt value of any of the adjacent squares ). The distance can be got as sum of differences in row values and difference in column values of the points. Once target point is decided then, bot tends to move within rectangle formed by the source and target points. Now greedy algorithm is applied for adjacent points within this rectangle.If 2 adjacent points compete for selection by greedy algorithm and both have equal dirt values then the adjacent square in direction which has greater rectangle side length is chosen. This is done because in direction of greater rectangle side length, we end up in reducing lesser squares from original rectangle to obtain rectangle for newer location. The bot checks again for all points for any better target point from the newer postion and updates the target accordingly. As at each step, the target point remains same or gets updated to be more beneficial, hence this bot would serve better than Greedy bot. The bot is deterministic. USING CODE #define N 5 //TO CONTROL THE OUTPUT #define ROBOT 'B' // SELECTING ROBOT 'A' or 'B' or 'C'