


"""simple docstring"""







def 					a__			(				SCREAMING_SNAKE_CASE    :    list[int]				):


  '''simple docstring'''







  if not numbers:
    return 0

  if not isinstance(SCREAMING_SNAKE_CASE				,      (list, tuple)				) or not all(
      isinstance(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				) for number in numbers				):
    raise ValueError("numbers must be an iterable of integers"				)

  lowerCAmelCase     :     str								=							numbers[0]

  for i in range(1				,      len(SCREAMING_SNAKE_CASE				)				):
    # update the maximum and minimum subarray products
    lowerCAmelCase     :     int								=							numbers[i]
    if number < 0:
      lowerCAmelCase						,  lowerCAmelCase     :     Union[str, Any]								=							min_till_now, max_till_now
    lowerCAmelCase     :     List[Any]								=							max(SCREAMING_SNAKE_CASE				,      max_till_now * number				)
    lowerCAmelCase     :     List[Any]								=							min(SCREAMING_SNAKE_CASE				,      min_till_now * number				)

    # update the maximum product found till now
    lowerCAmelCase     :     str								=							max(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				)

  return max_prod









"""simple docstring"""







def 					a__			(				SCREAMING_SNAKE_CASE    :    float				,      SCREAMING_SNAKE_CASE    :    float				,      SCREAMING_SNAKE_CASE    :    int				):


  '''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(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				):
    raise Exception("Years to repay must be an integer > 0"				)

  # Yearly rate is divided by 12 to get monthly rate
  lowerCAmelCase     :     Tuple								=							rate_per_annum / 1_2

  # Years to repay is multiplied by 12 to get number of payments as payment is monthly
  lowerCAmelCase     :     List[Any]								=							years_to_repay * 1_2

  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()





