


"""simple docstring"""





snake_case__		:     Any    				=				[
    (1_000, '''M'''),
    (900, '''CM'''),
    (500, '''D'''),
    (400, '''CD'''),
    (100, '''C'''),
    (90, '''XC'''),
    (50, '''L'''),
    (40, '''XL'''),
    (10, '''X'''),
    (9, '''IX'''),
    (5, '''V'''),
    (4, '''IV'''),
    (1, '''I'''),
]


def      _snake_case						(						_snake_case				:			str			):
      lowerCAmelCase					:	Any       =   {'''I''': 1, '''V''': 5, '''X''': 10, '''L''': 50, '''C''': 100, '''D''': 500, '''M''': 1000}
      lowerCAmelCase					:	str       =   0
      lowerCAmelCase					:	Dict       =   0
      while place < len(_snake_case			):
            if (place + 1 < len(_snake_case			)) and (vals[roman[place]] < vals[roman[place + 1]]):
                  total += vals[roman[place + 1]] - vals[roman[place]]
                  place += 2
            else:
                  total += vals[roman[place]]
                  place += 1
      return total


def      _snake_case						(						_snake_case				:			int			):
      lowerCAmelCase					:	Dict       =   []
      for arabic, roman in ROMAN:
            ((lowerCAmelCase),      (lowerCAmelCase))					:	List[Any]       =   divmod(_snake_case ,   _snake_case			)
            result.append(roman * factor			)
            if number == 0:
                  break
      return "".join(_snake_case			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()






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


