
from __future__ import annotations





def    _a (						lowerCamelCase,     lowerCamelCase,     lowerCamelCase							):
 assert n > 1 and a > 0 and greatest_common_divisor(lowerCamelCase,     lowerCamelCase							) == 1
 ((lowerCamelCase)      ,   (lowerCamelCase)      ,   (lowerCamelCase))		:     List[str]          =				extended_gcd(lowerCamelCase,     lowerCamelCase							)  # Implemented below
 lowerCamelCase		:     int          =				(b * s) % n
 return x





def    _a (						lowerCamelCase,     lowerCamelCase							):
 ((lowerCamelCase)      ,   (lowerCamelCase))		:     Dict          =				extended_euclid(lowerCamelCase,     lowerCamelCase							)  # Implemented below
 if b < 0:
  lowerCamelCase		:     List[Any]          =				(b % n + n) % n
 return b





def    _a (						lowerCamelCase,     lowerCamelCase,     lowerCamelCase							):
 lowerCamelCase		:     Optional[int]          =				invert_modulo(lowerCamelCase,     lowerCamelCase							)
 lowerCamelCase		:     Optional[Any]          =				(b * s) % n
 return x





def    _a (						lowerCamelCase,     lowerCamelCase							):
 assert a >= 0 and b >= 0

 if b == 0:
  lowerCamelCase      ,   lowerCamelCase      ,   lowerCamelCase		:     int          =				a, 1, 0
 else:
  ((lowerCamelCase)      ,   (lowerCamelCase)      ,   (lowerCamelCase))		:     Dict          =				extended_gcd(lowerCamelCase,     a % b							)
  lowerCamelCase		:     Union[str, Any]          =				q
  lowerCamelCase		:     Any          =				p - q * (a // b)

 assert a % d == 0 and b % d == 0
 assert d == a * x + b * y

 return (d, x, y)





def    _a (						lowerCamelCase,     lowerCamelCase							):
 if b == 0:
  return (1, 0)
 ((lowerCamelCase)      ,   (lowerCamelCase))		:     Optional[int]          =				extended_euclid(lowerCamelCase,     a % b							)
 lowerCamelCase		:     Union[str, Any]          =				a // b
 return (y, x - k * y)





def    _a (						lowerCamelCase,     lowerCamelCase							):
 if a < b:
  lowerCamelCase      ,   lowerCamelCase		:     Dict          =				b, a

 while a % b != 0:
  lowerCamelCase      ,   lowerCamelCase		:     int          =				b, a % b

 return b


if __name__ == "__main__":
      from doctest import testmod

      testmod(name="""modular_division""", verbose=True)
      testmod(name="""modular_division2""", verbose=True)
      testmod(name="""invert_modulo""", verbose=True)
      testmod(name="""extended_gcd""", verbose=True)
      testmod(name="""extended_euclid""", verbose=True)
      testmod(name="""greatest_common_divisor""", verbose=True)






def    _a (						lowerCamelCase,     lowerCamelCase,     lowerCamelCase							):
 lowerCamelCase		:     Optional[int]          =				[1 / first_term]
 lowerCamelCase		:     Any          =				1 / first_term
 for _ in range(number_of_terms - 1							):
  first_term += common_difference
  arithmetic_progression.append(lowerCamelCase							)
 lowerCamelCase		:     Optional[Any]          =				[1 / step for step in arithmetic_progression]
 return sum(lowerCamelCase							)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      print(sum_of_harmonic_progression(1 / 2, 2, 2))




