Imagine that we have a grid of M x N cells, each of which has a pile of gold. Write a program that finds the maximum amount of gold that can be collected along the path between the top left corner and the bottom right corner of the grid, provided that you can move only to the right or to the bottom of each cell:
The input of the program must be following:
First line is the number of rows N (3 ≤ N ≤ 10), the second line is the number of cells M (3 ≤ M ≤ 10) in each row and then N lines of M positive integers in each separated by blank spaces, representing the amount of gold in each cell.