Company: Goldman sachs_19aug
Difficulty: medium
RoboMax Path Problem Description RoboMax is a patrol robot stationed in a high-tech warehouse represented as a grid with R rows and C columns. The robot starts its patrol at the top-left corner of the grid and must finish at the bottom-right corner. The warehouse is divided into square zones, each assigned a reward value indicating how much valuable data RoboMax can collect while passing through that zone. However, RoboMax has limited battery power and can only visit each zone once. It can move only to an adjacent zone (up, down, left, or right). Not all zones need to be visited, but RoboMax aims to maximize the total reward value it collects during the patrol. If multiple maximum-reward paths exist, RoboMax will enumerate them all, sort them lexicographically by their move string, and travel along the lexicographically first path. Your task is to help RoboMax with a program that determines such a path. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary st