



from __future__ import annotations

import sys


def 						UpperCAmelCase__   (   UpperCAmelCase__			:int			,       UpperCAmelCase__			:int       ):






 '''simple docstring'''

 if abs(UpperCAmelCase__       ) == 1:
  return a, 0
 elif abs(UpperCAmelCase__       ) == 1:
  return 0, b

 a		,	a							=		a, b
 a		,	a							=		1, 0
 a		,	a							=		0, 1

 while remainder != 0:
  a							=		old_remainder // remainder
  a		,	a							=		remainder, old_remainder - quotient * remainder
  a		,	a							=		coeff_a, old_coeff_a - quotient * coeff_a
  a		,	a							=		coeff_b, old_coeff_b - quotient * coeff_b

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

 return old_coeff_a, old_coeff_b


def 						UpperCAmelCase__   (   ):






 '''simple docstring'''

 if len(sys.argv       ) < 3:
  print("2 integer arguments required"       )
  return 1
 a							=		int(sys.argv[1]       )
 a							=		int(sys.argv[2]       )
 print(extended_euclidean_algorithm(UpperCAmelCase__			,       UpperCAmelCase__       )       )
 return 0


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






from __future__ import annotations


def 						UpperCAmelCase__   (   UpperCAmelCase__			:float | int			,       UpperCAmelCase__			:float | int			,       UpperCAmelCase__			:float | int			,       ):






 '''simple docstring'''

 if not all((nth_term, start_term_a, common_ratio_r)       ):
  return []
 a							=		[]
 a							=		1
 a							=		common_ratio_r
 for _ in range(int(UpperCAmelCase__       )       ):
  if not series:
   series.append(UpperCAmelCase__       )
  else:
   power += 1
   series.append(float(start_term_a * multiple       )       )
   a							=		pow(float(UpperCAmelCase__       )			,       UpperCAmelCase__       )
 return series


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     A_		:  Optional[Any]										=  float(input('''Enter the last number (n term) of the Geometric Series'''))
     A_		:  Optional[Any]										=  float(input('''Enter the starting term (a) of the Geometric Series'''))
     A_		:  Optional[int]										=  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))

