
'''simple docstring'''






def 		A_							(						_lowerCAmelCase :     Optional[Any]					,						_lowerCAmelCase :     str				):



      """simple docstring"""




      if not len(UpperCamelCase__				) == len(UpperCamelCase__				) == 3:
            raise ValueError("Please enter a valid equation."				)
      if equationa[0] == equationa[1] == equationa[0] == equationa[1] == 0:
            raise ValueError("Both a & b of two equations can\'t be zero."				)

      # Extract the coefficients
      _lowerCamelCase    ,		_lowerCamelCase    ,		_lowerCamelCase					: Union[str, Any]		    = equationa
      _lowerCamelCase    ,		_lowerCamelCase    ,		_lowerCamelCase					: Optional[Any]		    = equationa

      # Calculate the determinants of the matrices
      _lowerCamelCase					: Dict		    = aa * ba - aa * ba
      _lowerCamelCase					: Dict		    = ca * ba - ca * ba
      _lowerCamelCase					: Dict		    = aa * ca - aa * ca

      # Check if the system of linear equations has a solution (using Cramer's rule)
      if determinant == 0:
            if determinant_x == determinant_y == 0:
                  raise ValueError("Infinite solutions. (Consistent system)"				)
            else:
                  raise ValueError("No solution. (Inconsistent system)"				)
      else:
            if determinant_x == determinant_y == 0:
                  # Trivial solution (Inconsistent system)
                  return (0.0, 0.0)
            else:
                  _lowerCamelCase					: Optional[Any]		    = determinant_x / determinant
                  _lowerCamelCase					: Optional[int]		    = determinant_y / determinant
                  # Non-Trivial Solution (Consistent system)
                  return (x, y)
'''simple docstring'''




def __lowerCAmelCase					(				UpperCamelCase__							)      ->       float:
    __lowerCamelCase            =    0
    while len(UpperCamelCase__							) > 1:
        __lowerCamelCase            =    0
        # Consider two files with minimum cost to be merged
        for _ in range(2							):
            __lowerCamelCase            =    files.index(min(UpperCamelCase__							)							)
            temp += files[min_index]
            files.pop(UpperCamelCase__							)
        files.append(UpperCamelCase__							)
        optimal_merge_cost += temp
    return optimal_merge_cost


if __name__ == "__main__":
  import doctest

  doctest.testmod()
