




def 		_A(       UpperCamelCase__							:			int				,       UpperCamelCase__							:			Any				,       UpperCamelCase__							:			List[str]				)    -> Union[str, Any]:
       '''simple docstring'''


       if principal <= 0:
              raise Exception('''Principal borrowed must be > 0'''				)
       if rate_per_annum < 0:
              raise Exception('''Rate of interest must be >= 0'''				)
       if years_to_repay <= 0 or not isinstance(_lowerCAmelCase				,       _lowerCAmelCase				):
              raise Exception('''Years to repay must be an integer > 0'''				)

       # Yearly rate is divided by 12 to get monthly rate
       __lowercase      =    rate_per_annum / 12

       # Years to repay is multiplied by 12 to get number of payments as payment is monthly
       __lowercase      =    years_to_repay * 12

       return (
           principal
           * rate_per_month
           * (1 + rate_per_month) ** number_of_payments
           / ((1 + rate_per_month) ** number_of_payments - 1)
       )


if __name__ == "__main__":
   import doctest

   doctest.testmod()












import os







def 		_A(       UpperCamelCase__							:			str = "matrix.txt"				)    -> int:
							'''simple docstring'''


							with open(os.path.join(os.path.dirname(UpperCamelCase__				)				,       UpperCamelCase__				)				) as in_file:
														__lowercase      =    in_file.read()

							__lowercase      =    [[int(UpperCamelCase__				) for cell in row.split(''','''				)] for row in data.strip().splitlines()]
							__lowercase      =    [[0 for cell in row] for row in grid]
							__lowercase      =    len(grid[0]				)

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

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

							return dp[-1][-1]


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






