




'''simple docstring'''





def UpperCAmelCase    (       UpperCAmelCase_						):
    if not isinstance(UpperCAmelCase_   ,	UpperCAmelCase_						):
        raise ValueError("""Input series is not valid, valid series - [1, 2/3, 2]"""						)
    if len(UpperCAmelCase_						) == 0:
        raise ValueError("""Input list must be a non empty list"""						)
    if len(UpperCAmelCase_						) == 1 and series[0] != 0:
        return True
    _a				:							Tuple							       =      []
    _a				:							Union[str, Any]							       =      len(UpperCAmelCase_						)
    for i in range(0   ,	UpperCAmelCase_						):
        if series[i] == 0:
            raise ValueError("""Input series cannot have 0 as an element"""						)
        rec_series.append(1 / series[i]						)
    _a				:							List[Any]							       =      rec_series[1] - rec_series[0]
    for index in range(2   ,	UpperCAmelCase_						):
        if rec_series[index] - rec_series[index - 1] != common_diff:
            return False
    return True





def UpperCAmelCase    (       UpperCAmelCase_						):
    if not isinstance(UpperCAmelCase_   ,	UpperCAmelCase_						):
        raise ValueError("""Input series is not valid, valid series - [2, 4, 6]"""						)
    if len(UpperCAmelCase_						) == 0:
        raise ValueError("""Input list must be a non empty list"""						)
    _a				:							Dict							       =      0
    for val in series:
        answer += 1 / val
    return len(UpperCAmelCase_						) / answer


if __name__ == "__main__":
  import doctest

  doctest.testmod()








'''simple docstring'''





from __future__ import annotations

import sys





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_						):
    # base cases
    if abs(UpperCAmelCase_						) == 1:
        return a, 0
    elif abs(UpperCAmelCase_						) == 1:
        return 0, b

    _a       , _a				:							List[Any]							       =      a, b
    _a       , _a				:							str							       =      1, 0
    _a       , _a				:							Union[str, Any]							       =      0, 1

    while remainder != 0:
        _a				:							List[Any]							       =      old_remainder // remainder
        _a       , _a				:							str							       =      remainder, old_remainder - quotient * remainder
        _a       , _a				:							Optional[Any]							       =      coeff_a, old_coeff_a - quotient * coeff_a
        _a       , _a				:							Tuple							       =      coeff_b, old_coeff_b - quotient * coeff_b

    # sign correction for negative numbers
    if a < 0:
        _a				:							Tuple							       =      -old_coeff_a
    if b < 0:
        _a				:							Any							       =      -old_coeff_b

    return old_coeff_a, old_coeff_b





def UpperCAmelCase    (       ):
    if len(sys.argv						) < 3:
        print("""2 integer arguments required"""						)
        return 1
    _a				:							Union[str, Any]							       =      int(sys.argv[1]						)
    _a				:							Any							       =      int(sys.argv[2]						)
    print(extended_euclidean_algorithm(UpperCAmelCase_   ,	UpperCAmelCase_						)						)
    return 0


if __name__ == "__main__":
  raise SystemExit(main())


