Function to preprcess input mat [ N ] [ M ] . This function mainly fills dp [ N ] [ M ] such that dp [ i ] [ j ] stores sum of elements from ( 0 , 0 ) to ( i , j )
using System ; public class GFG { static void preProcess ( int [ , ] mat , int [ , ] dp , int n , int m ) {