






'''simple docstring'''
a_					= [
    (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  _a(  UpperCamelCase__				:						str							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__     :				Optional[Any]									={'''I''': 1, '''V''': 5, '''X''': 1_0, '''L''': 5_0, '''C''': 1_0_0, '''D''': 5_0_0, '''M''': 1_0_0_0}
      SCREAMING_SNAKE_CASE__     :				Dict									=0
      SCREAMING_SNAKE_CASE__     :				int									=0
      while place < len(UpperCamelCase__							):
            if (place + 1 < len(UpperCamelCase__							)) 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  _a(  UpperCamelCase__				:						int							):




      '''simple docstring'''






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


if __name__ == "__main__":
  import doctest

  doctest.testmod()







'''simple docstring'''
from __future__ import annotations

import numpy as np
from numpy import floataa
from numpy.typing import NDArray





def  _a(  UpperCamelCase__				:						NDArray[floataa],	UpperCamelCase__				:						NDArray[floataa],	UpperCamelCase__				:						list[int],	UpperCamelCase__				:						int,	):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__		,	SCREAMING_SNAKE_CASE__     :				Tuple									=coefficient_matrix.shape
      SCREAMING_SNAKE_CASE__		,	SCREAMING_SNAKE_CASE__     :				Tuple									=constant_matrix.shape

      if rowsa != colsa:
            SCREAMING_SNAKE_CASE__     :				Any									=f"Coefficient matrix dimensions must be nxn but received {rowsa}x{colsa}"
            raise ValueError(UpperCamelCase__							)

      if colsa != 1:
            SCREAMING_SNAKE_CASE__     :				str									=f"Constant matrix must be nx1 but received {rowsa}x{colsa}"
            raise ValueError(UpperCamelCase__							)

      if rowsa != rowsa:
            SCREAMING_SNAKE_CASE__     :				str									=(
                '''Coefficient and constant matrices dimensions must be nxn and nx1 but '''
                f"received {rowsa}x{colsa} and {rowsa}x{colsa}"
            )
            raise ValueError(UpperCamelCase__							)

      if len(UpperCamelCase__							) != rowsa:
            SCREAMING_SNAKE_CASE__     :				Union[str, Any]									=(
                '''Number of initial values must be equal to number of rows in coefficient '''
                f"matrix but received {len(UpperCamelCase__							)} and {rowsa}"
            )
            raise ValueError(UpperCamelCase__							)

      if iterations <= 0:
            raise ValueError('''Iterations must be at least 1'''							)

      SCREAMING_SNAKE_CASE__     :				NDArray[floataa]									=np.concatenate(
          (coefficient_matrix, constant_matrix),	axis=1							)

      SCREAMING_SNAKE_CASE__		,	SCREAMING_SNAKE_CASE__     :				Any									=table.shape

      strictly_diagonally_dominant(UpperCamelCase__							)

      # Iterates the whole matrix for given number of times
      for _ in range(UpperCamelCase__							):
            SCREAMING_SNAKE_CASE__     :				List[str]									=[]
            for row in range(UpperCamelCase__							):
                  SCREAMING_SNAKE_CASE__     :				Optional[Any]									=0
                  for col in range(UpperCamelCase__							):
                        if col == row:
                              SCREAMING_SNAKE_CASE__     :				int									=table[row][col]
                        elif col == cols - 1:
                              SCREAMING_SNAKE_CASE__     :				Any									=table[row][col]
                        else:
                              temp += (-1) * table[row][col] * init_val[col]
                  SCREAMING_SNAKE_CASE__     :				int									=(temp + val) / denom
                  new_val.append(UpperCamelCase__							)
            SCREAMING_SNAKE_CASE__     :				Optional[Any]									=new_val

      return [float(UpperCamelCase__							) for i in new_val]





def  _a(  UpperCamelCase__				:						NDArray[floataa]							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__		,	SCREAMING_SNAKE_CASE__     :				Optional[int]									=table.shape

      SCREAMING_SNAKE_CASE__     :				Any									=True

      for i in range(0,	UpperCamelCase__							):
            SCREAMING_SNAKE_CASE__     :				int									=0
            for j in range(0,	cols - 1							):
                  if i == j:
                        continue
                  else:
                        total += table[i][j]

            if table[i][i] <= total:
                  raise ValueError('''Coefficient matrix is not strictly diagonally dominant'''							)

      return is_diagonally_dominant


# Test Cases
if __name__ == "__main__":
  import doctest

  doctest.testmod()