






'''simple docstring'''




import os







def       __UpperCAmelCase						(  lowerCamelCase_ = "input.txt")							->     int:

		with open(os.path.join(os.path.dirname(lowerCamelCase_)     ,      lowerCamelCase_)) as input_file:
				UpperCamelCase__				:					Tuple					=					[
				    [int(lowerCamelCase_) for element in line.split(',')]
				    for line in input_file.readlines()
				]

		UpperCamelCase__				:					Union[str, Any]					=					len(lowerCamelCase_)
		UpperCamelCase__				:					str					=					len(matrix[0])

		UpperCamelCase__				:					str					=					[[-1 for _ in range(lowerCamelCase_)] for _ in range(lowerCamelCase_)]
		for i in range(lowerCamelCase_):
				UpperCamelCase__				:					Dict					=					matrix[i][0]

		for j in range(1     ,      lowerCamelCase_):
				for i in range(lowerCamelCase_):
						UpperCamelCase__				:					List[Any]					=					minimal_path_sums[i][j - 1] + matrix[i][j]

				for i in range(1     ,      lowerCamelCase_):
						UpperCamelCase__				:					Optional[int]					=					min(
						    minimal_path_sums[i][j]     ,      minimal_path_sums[i - 1][j] + matrix[i][j])

				for i in range(rows - 2     ,      -1     ,      -1):
						UpperCamelCase__				:					List[Any]					=					min(
						    minimal_path_sums[i][j]     ,      minimal_path_sums[i + 1][j] + matrix[i][j])

		return min(minimal_path_sums_row[-1] for minimal_path_sums_row in minimal_path_sums)


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












'''simple docstring'''




from math import log

from scipy.constants import Boltzmann, physical_constants

lowerCAmelCase__          =						300  # TEMPERATURE (unit = K)







def       __UpperCAmelCase						(  lowerCamelCase_     ,      lowerCamelCase_     ,      lowerCamelCase_     ,      )							->     float:

		if donor_conc <= 0:
				raise ValueError('Donor concentration should be positive')
		elif acceptor_conc <= 0:
				raise ValueError('Acceptor concentration should be positive')
		elif intrinsic_conc <= 0:
				raise ValueError('Intrinsic concentration should be positive')
		elif donor_conc <= intrinsic_conc:
				raise ValueError(
				    'Donor concentration should be greater than intrinsic concentration')
		elif acceptor_conc <= intrinsic_conc:
				raise ValueError(
				    'Acceptor concentration should be greater than intrinsic concentration')
		else:
				return (
				    Boltzmann
				    * T
				    * log((donor_conc * acceptor_conc) / intrinsic_conc**2)
				    / physical_constants["electron volt"][0]
				)


if __name__ == "__main__":
		import doctest

		doctest.testmod()




