Mouse and corns
Medium
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
In the Indian temple the floor has rectangular form filled with identical square tiles . Each tile contains from to corns. A mouse runs out from a left lower corner and go to the exit in right upper corner.
Mouse can go only right or forward, collecting all the corns from the tiles where it resides.
Find the route, where mouse can take as much corn as possible.
Input
The first line contains and — the floor size. Next we have lines, starting from top, each contains numbers — the number of corns on the floor.
Output
Print the route of the mouse in format: RRFFFRF (F — step forward, R — step right).
Examples
Input #1
Answer #1
Submissions 27K
Acceptance rate 28%