
import os

lowerCamelCase__     :		int        = {"""I""": 1, """V""": 5, """X""": 1_0, """L""": 5_0, """C""": 1_0_0, """D""": 5_0_0, """M""": 1_0_0_0}

def 		UpperCamelCase						(   lowercase_ )		->						int:


  '''simple docstring'''






  lowercase__	: Optional[Any]     		=   0

  lowercase__	: List[str]     		=   0
  while index < len(lowercase_ ) - 1:
    lowercase__	: str     		=   SYMBOLS[numerals[index]]
    lowercase__	: str     		=   SYMBOLS[numerals[index + 1]]
    if current_value < next_value:
      total_value -= current_value
    else:
      total_value += current_value
    index += 1
  total_value += SYMBOLS[numerals[index]]

  return total_value

def 		UpperCamelCase						(   lowercase_ )		->						str:


  '''simple docstring'''






  lowercase__	: List[Any]     		=   """"""

  lowercase__	: List[Any]     		=   num // 10_00
  numerals += m_count * "M"
  num %= 10_00

  lowercase__	: List[Any]     		=   num // 1_00
  if c_count == 9:
    numerals += "CM"
    c_count -= 9
  elif c_count == 4:
    numerals += "CD"
    c_count -= 4
  if c_count >= 5:
    numerals += "D"
    c_count -= 5
  numerals += c_count * "C"
  num %= 1_00

  lowercase__	: Optional[Any]     		=   num // 10
  if x_count == 9:
    numerals += "XC"
    x_count -= 9
  elif x_count == 4:
    numerals += "XL"
    x_count -= 4
  if x_count >= 5:
    numerals += "L"
    x_count -= 5
  numerals += x_count * "X"
  num %= 10

  if num == 9:
    numerals += "IX"
    num -= 9
  elif num == 4:
    numerals += "IV"
    num -= 4
  if num >= 5:
    numerals += "V"
    num -= 5
  numerals += num * "I"

  return numerals

def 		UpperCamelCase						(   lowercase_ = "/p089_roman.txt" )		->						int:


  '''simple docstring'''






  lowercase__	: Optional[int]     		=   0

  with open(os.path.dirname(lowercase_ ) + roman_numerals_filename ) as filea:
    lowercase__	: int     		=   filea.readlines()

  for line in lines:
    lowercase__	: Optional[int]     		=   line.strip()
    lowercase__	: Dict     		=   parse_roman_numerals(lowercase_ )
    lowercase__	: int     		=   generate_roman_numerals(lowercase_ )
    savings += len(lowercase_ ) - len(lowercase_ )

  return savings


if __name__ == "__main__":
     print(f'''{solution() = }''')








import pytest

import datasets.config
from datasets.utils.info_utils import is_small_dataset




@pytest.mark.parametrize('''dataset_size'''		,  [None, 400 * 2**20, 600 * 2**20]   )
@pytest.mark.parametrize('''input_in_memory_max_size'''		,  ['''default''', 0, 100 * 2**20, 900 * 2**20]   )
def 							a		(				snake_case__:   int		,  snake_case__:   Dict		,  snake_case__:   Dict   ):


				'''simple docstring'''
				if input_in_memory_max_size != "default":
								monkeypatch.setattr(datasets.config		,  '''IN_MEMORY_MAX_SIZE'''		,  snake_case__   )
				lowercase_	    =   datasets.config.IN_MEMORY_MAX_SIZE
				if input_in_memory_max_size == "default":
								assert in_memory_max_size == 0
				else:
								assert in_memory_max_size == input_in_memory_max_size
				if dataset_size and in_memory_max_size:
								lowercase_	    =   dataset_size < in_memory_max_size
				else:
								lowercase_	    =   False
				lowercase_	    =   is_small_dataset(snake_case__   )
				assert result == expected




