Counting the minimum cost
temp = Math . Min ( floor [ i - 1 , j ] , floor [ i - 1 , j - 1 ] ) ; temp = Math . Min ( temp , floor [ i - 1 , j + 1 ] ) ; floor [ i , j ] = given [ i , j ] + temp ; } } min_odd_cost = int . MaxValue ;