


def        SCREAMING_SNAKE_CASE_						(			__A :			int  ,    __A :			Any				)	->		str:

       """simple docstring"""

       return abs(lowerCamelCase__				) if a == 0 else greatest_common_divisor(b % a  ,    lowerCamelCase__				)







def        SCREAMING_SNAKE_CASE_						(			__A :			List[str]  ,    __A :			List[str]				)	->		Union[str, Any]:

       """simple docstring"""

       while y:  # --> when y=0 then loop will terminate and return x as final GCD.
              a_					:		Optional[Any]							=  y, x % y
       return abs(lowerCamelCase__				)







def        SCREAMING_SNAKE_CASE_						(			)	->		Tuple:

       """simple docstring"""

       try:
              a_					:		str							=  input('Enter two integers separated by comma (,): '				).split(','				)
              a_					:		Union[str, Any]							=  int(nums[0]				)
              a_					:		Optional[Any]							=  int(nums[1]				)
              print(
                  F"""greatest_common_divisor({num_a}, {num_a}) = """
                  F"""{greatest_common_divisor(lowerCamelCase__  ,    lowerCamelCase__				)}"""				)
              print(F"""By iterative gcd({num_a}, {num_a}) = {gcd_by_iterative(lowerCamelCase__  ,    lowerCamelCase__				)}"""				)
       except (IndexError, UnboundLocalError, ValueError):
              print('Wrong input'				)


if __name__ == "__main__":
   main()







'''simple docstring'''




from math import pow



def 	a			( lowerCamelCase__						,      lowerCamelCase__						,      lowerCamelCase__						,      lowerCamelCase__						,      lowerCamelCase__						,      ):
			'''simple docstring'''





			if current_sum == needed_sum:
						# If the sum of the powers is equal to needed_sum, then we have a solution.
						solutions_count += 1
						return current_sum, solutions_count

			A_	:						Optional[int]	=     int(pow(lowerCamelCase__						,      lowerCamelCase__    )    )
			if current_sum + i_to_n <= needed_sum:
						# If the sum of the powers is less than needed_sum, then continue adding powers.
						current_sum += i_to_n
						A_,    A_	:						int	=     backtrack(
						    lowerCamelCase__						,      lowerCamelCase__						,      current_number + 1						,      lowerCamelCase__						,      lowerCamelCase__    )
						current_sum -= i_to_n
			if i_to_n < needed_sum:
						# If the power of i is less than needed_sum, then try with the next power.
						A_,    A_	:						int	=     backtrack(
						    lowerCamelCase__						,      lowerCamelCase__						,      current_number + 1						,      lowerCamelCase__						,      lowerCamelCase__    )
			return current_sum, solutions_count



def 	a			( lowerCamelCase__						,      lowerCamelCase__    ):
			'''simple docstring'''





			if not (1 <= needed_sum <= 10_00 and 2 <= power <= 10):
						raise ValueError(
						    """Invalid input\n"""
						    """needed_sum must be between 1 and 1000, power between 2 and 10."""    )

			return backtrack(lowerCamelCase__						,      lowerCamelCase__						,      1						,      0						,      0    )[1]  # Return the solutions_count


if __name__ == "__main__":
						import doctest

						doctest.testmod()