from __future__ import annotations







def 	UpperCAmelCase       (		lowerCAmelCase_						,      lowerCAmelCase_						,      lowerCAmelCase_       )	->	tuple[float, float]:
     assert (
         c % greatest_common_divisor(lowerCAmelCase_						,      lowerCAmelCase_       ) == 0
     )  # greatest_common_divisor(a,b) function implemented below
     ((a)			,							(a)			,							(a))  :    List[Any]				=						extended_gcd(lowerCAmelCase_						,      lowerCAmelCase_       )  # extended_gcd(a,b) function implemented below
     a  :    List[str]				=						c / d
     return (r * x, r * y)







def 	UpperCAmelCase       (		lowerCAmelCase_						,      lowerCAmelCase_						,      lowerCAmelCase_						,      lowerCAmelCase_ = 2       )	->	None:
     ((a)			,							(a))  :    Tuple				=						diophantine(lowerCAmelCase_						,      lowerCAmelCase_						,      lowerCAmelCase_       )  # Initial value
     a  :    Tuple				=						greatest_common_divisor(lowerCAmelCase_						,      lowerCAmelCase_       )
     a  :    Optional[int]				=						a // d
     a  :    Optional[Any]				=						b // d

     for i in range(lowerCAmelCase_       ):
          a  :    Optional[Any]				=						xa + i * q
          a  :    List[str]				=						ya - i * p
          print(lowerCAmelCase_						,      lowerCAmelCase_       )







def 	UpperCAmelCase       (		lowerCAmelCase_						,      lowerCAmelCase_       )	->	int:
     if a < b:
          a			,							a  :    str				=						b, a

     while a % b != 0:
          a			,							a  :    Tuple				=						b, a % b

     return b







def 	UpperCAmelCase       (		lowerCAmelCase_						,      lowerCAmelCase_       )	->	tuple[int, int, int]:
     assert a >= 0 and b >= 0

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

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

     return (d, x, y)


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

  testmod(name="""diophantine""", verbose=True)
  testmod(name="""diophantine_all_soln""", verbose=True)
  testmod(name="""extended_gcd""", verbose=True)
  testmod(name="""greatest_common_divisor""", verbose=True)
from __future__ import annotations







def 	UpperCAmelCase       (		lowerCAmelCase_						,      lowerCAmelCase_						,      lowerCAmelCase_						,      )	->	list[float | int]:
     if not all((nth_term, start_term_a, common_ratio_r)       ):
          return []
     a  :    list[float | int]				=						[]
     a  :    str				=						1
     a  :    Dict				=						common_ratio_r
     for _ in range(int(lowerCAmelCase_       )       ):
          if not series:
               series.append(lowerCAmelCase_       )
          else:
               power += 1
               series.append(float(start_term_a * multiple       )       )
               a  :    Dict				=						pow(float(lowerCAmelCase_       )						,      lowerCAmelCase_       )
     return series


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  UpperCAmelCase							   =      float(input("""Enter the last number (n term) of the Geometric Series"""))
  UpperCAmelCase							   =      float(input("""Enter the starting term (a) of the Geometric Series"""))
  UpperCAmelCase							   =      float(
      input("""Enter the common ratio between two terms (r) of the Geometric Series""")
  )
  print("""Formula of Geometric Series => a + ar + ar^2 ... +ar^n""")
  print(geometric_series(nth_term, start_term_a, common_ratio_r))