
'''simple docstring'''







_lowercase :  Any    							=       [
    (1_0_0_0, "M"),
    (9_0_0, "CM"),
    (5_0_0, "D"),
    (4_0_0, "CD"),
    (1_0_0, "C"),
    (9_0, "XC"),
    (5_0, "L"),
    (4_0, "XL"),
    (1_0, "X"),
    (9, "IX"),
    (5, "V"),
    (4, "IV"),
    (1, "I"),
]
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: str							):



						"""simple docstring"""





						lowercase_	:     Tuple													=       {'''I''': 1, '''V''': 5, '''X''': 10, '''L''': 50, '''C''': 100, '''D''': 500, '''M''': 1000}
						lowercase_	:     List[Any]													=       0
						lowercase_	:     Union[str, Any]													=       0
						while place < len(__SCREAMING_SNAKE_CASE							):
												if (place + 1 < len(__SCREAMING_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_		(				__SCREAMING_SNAKE_CASE					: int							):



						"""simple docstring"""





						lowercase_	:     str													=       []
						for arabic, roman in ROMAN:
												((lowercase_)						, (lowercase_))	:     Optional[int]													=       divmod(__SCREAMING_SNAKE_CASE      ,      __SCREAMING_SNAKE_CASE							)
												result.append(roman * factor							)
												if number == 0:
																		break
						return "".join(__SCREAMING_SNAKE_CASE							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()





'''simple docstring'''







import unittest

from knapsack import greedy_knapsack as kp






class  lowerCAmelCase__   (  unittest.TestCase     ):






					def 	_snake_case    (   self		):


											"""simple docstring"""





											lowercase_	:     List[str]													=       [10, 20, 30, 40, 50, 60]
											lowercase_	:     Optional[Any]													=       [2, 4, 6, 8, 10, 12]
											lowercase_	:     Union[str, Any]													=       1_00
											self.assertEqual(kp.calc_profit(__SCREAMING_SNAKE_CASE				,							__SCREAMING_SNAKE_CASE				,							__SCREAMING_SNAKE_CASE		)				,							2_10		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											self.assertRaisesRegex(__SCREAMING_SNAKE_CASE				,							'''max_weight must greater than zero.'''		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											self.assertRaisesRegex(__SCREAMING_SNAKE_CASE				,							'''Weight can not be negative.'''		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											self.assertRaisesRegex(__SCREAMING_SNAKE_CASE				,							'''Profit can not be negative.'''		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											self.assertRaisesRegex(__SCREAMING_SNAKE_CASE				,							'''max_weight must greater than zero.'''		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											self.assertRaisesRegex(
											    __SCREAMING_SNAKE_CASE				,							'''The length of profit and weight must be same.'''		)


if __name__ == "__main__":
							unittest.main()



