Mouse and corns

In the Indian temple the floor has rectangular form filled with identical square tiles 1õ1. Each tile contains from 0 to k (k ≤ 30000) 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 on which it resides.
Find the route, where mouse can take as much corn as possible.
Specifications
Input
The first line contains m and n – the floor size (1 ≤ m, n ≤ 100). Next we have m lines, begining from up, which have n numbers in each – it is amount of corns on the floor.
Output
Print the route of mouse in format: RRFFFRF (F – step forward, R – step right).
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 8.33333
Complexity: 39% 360/590
Classes: Dynamic programming
Example
Example input2 3 3 2 4 1 5 1 |
Example outputRFR |
| ← Rabbit-failure | Problems | Dragon → |
