


"""simple docstring"""







from math import ceil
def 					a__			(				SCREAMING_SNAKE_CASE    :    int = 1_0_0_1				):


  '''simple docstring'''







  lowerCAmelCase     :     Dict								=							1

  for i in range(1				,      int(ceil(n / 2.0				)				)				):
    lowerCAmelCase     :     Union[str, Any]								=							2 * i + 1
    lowerCAmelCase     :     Dict								=							2 * i
    lowerCAmelCase     :     Dict								=							total + 4 * odd**2 - 6 * even

  return total


if __name__ == "__main__":
     import sys

     if len(sys.argv) == 1:
          print(solution())
     else:
          try:
               lowerCAmelCase__      				=   int(sys.argv[1])
               print(solution(n))
          except ValueError:
               print('''Invalid entry - please enter a number''')









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





