Initialize first row - First column of tSum array
for ( i = 1 ; i < l ; i ++ ) for ( j = 1 ; j < m ; j ++ ) tSum [ i , j , 0 ] = min ( tSum [ i - 1 , j , 0 ] , tSum [ i , j - 1 , 0 ] , int . MaxValue ) + arr [ i , j , 0 ] ;