


"""simple docstring"""





from math import factorial


def      _snake_case						(						_snake_case				:			str = 20			):
      lowerCAmelCase					:	Optional[Any]       =   2 * n  # middle entry of odd rows starting at row 3 is the solution for n = 1,
      # 2, 3,...
      lowerCAmelCase					:	Optional[Any]       =   n // 2

      return int(factorial(_snake_case			) / (factorial(_snake_case			) * factorial(n - k			))			)


if __name__ == "__main__":
 import sys

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






"""simple docstring"""





def      _snake_case						(						_snake_case				:			float ,   _snake_case				:			list[float]			):
      if discount_rate < 0:
            raise ValueError('''Discount rate cannot be negative'''			)
      if not cash_flows:
            raise ValueError('''Cash flows list cannot be empty'''			)
      lowerCAmelCase					:	List[str]       =   sum(
          cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(_snake_case			)			)
      return round(_snake_case ,   ndigits=2			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()


