




'''simple docstring'''





import os


def 					UpperCamelCase_(     snake_case							:	str = "matrix.txt"					):

							'''simple docstring'''






							with open(os.path.join(os.path.dirname(snake_case					)							,    snake_case					)					) as in_file:
														snake_case_      =				in_file.read()

							snake_case_      =				[[int(snake_case					) for cell in row.split(","					)] for row in data.strip().splitlines()]
							snake_case_      =				[[0 for cell in row] for row in grid]
							snake_case_      =				len(grid[0]					)

							snake_case_      =				[[0 for i in range(snake_case					)] for j in range(snake_case					)]
							snake_case_      =				grid[0][0]
							for i in range(1							,    snake_case					):
														snake_case_      =				grid[0][i] + dp[0][i - 1]
							for i in range(1							,    snake_case					):
														snake_case_      =				grid[i][0] + dp[i - 1][0]

							for i in range(1							,    snake_case					):
														for j in range(1							,    snake_case					):
																					snake_case_      =				grid[i][j] + min(dp[i - 1][j]							,    dp[i][j - 1]					)

							return dp[-1][-1]


if __name__ == "__main__":
		print(F"{solution() = }")










'''simple docstring'''





def 					UpperCamelCase_(     snake_case							:	list[int]							,    snake_case							:	int					):

							'''simple docstring'''






							snake_case_      =				len(snake_case					)
							snake_case_      =				[[False] * (required_sum + 1) for _ in range(arr_len + 1					)]

							# for each arr value, a sum of zero(0) can be formed by not taking any element
							# hence True/1
							for i in range(arr_len + 1					):
														snake_case_      =				True

							# sum is not zero and set is empty then false
							for i in range(1							,    required_sum + 1					):
														snake_case_      =				False

							for i in range(1							,    arr_len + 1					):
														for j in range(1							,    required_sum + 1					):
																					if arr[i - 1] > j:
																												snake_case_      =				subset[i - 1][j]
																					if arr[i - 1] <= j:
																												snake_case_      =				subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]

							return subset[arr_len][required_sum]


if __name__ == "__main__":
		import doctest

		doctest.testmod()




