



from ..utils import DummyObject, requires_backends




class 						__lowercase		(metaclass=UpperCamelCase__							):




      """simple docstring"""





      _snake_case												=						["""torch""", """transformers""", """onnx"""]

      def __init__(				self    ,				*A    ,				**A     )		->    List[str]:
         requires_backends(self    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    int:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    List[str]:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )




class 						__lowercase		(metaclass=UpperCamelCase__							):




      """simple docstring"""





      _snake_case												=						["""torch""", """transformers""", """onnx"""]

      def __init__(				self    ,				*A    ,				**A     )		->    List[str]:
         requires_backends(self    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    Dict:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    int:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )




class 						__lowercase		(metaclass=UpperCamelCase__							):




      """simple docstring"""





      _snake_case												=						["""torch""", """transformers""", """onnx"""]

      def __init__(				self    ,				*A    ,				**A     )		->    int:
         requires_backends(self    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    List[Any]:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    Tuple:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )




class 						__lowercase		(metaclass=UpperCamelCase__							):




      """simple docstring"""





      _snake_case												=						["""torch""", """transformers""", """onnx"""]

      def __init__(				self    ,				*A    ,				**A     )		->    Any:
         requires_backends(self    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    Union[str, Any]:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    Any:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )




class 						__lowercase		(metaclass=UpperCamelCase__							):




      """simple docstring"""





      _snake_case												=						["""torch""", """transformers""", """onnx"""]

      def __init__(				self    ,				*A    ,				**A     )		->    Tuple:
         requires_backends(self    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    Any:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    str:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )




class 						__lowercase		(metaclass=UpperCamelCase__							):




      """simple docstring"""





      _snake_case												=						["""torch""", """transformers""", """onnx"""]

      def __init__(				self    ,				*A    ,				**A     )		->    List[str]:
         requires_backends(self    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    Any:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )

      @classmethod
      def      UpperCAmelCase				(				cls    ,				*A    ,				**A     )		->    Union[str, Any]:
         requires_backends(cls    ,				["""torch""", """transformers""", """onnx"""]     )











from math import pow




def 						SCREAMING_SNAKE_CASE__ (   lowercase						,lowercase						,lowercase						,lowercase						,lowercase						,)  ->       tuple[int, int]:
   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

   snake_case				:    Union[str, Any]           =	int(pow(lowercase						,lowercase					)					)
   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
      snake_case     , snake_case				:    List[Any]           =	backtrack(
          lowercase						,lowercase						,current_number + 1						,lowercase						,lowercase					)
      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.
      snake_case     , snake_case				:    str           =	backtrack(
          lowercase						,lowercase						,current_number + 1						,lowercase						,lowercase					)
   return current_sum, solutions_count




def 						SCREAMING_SNAKE_CASE__ (   lowercase						,lowercase					)  ->       int:
   if not (1 <= needed_sum <= 1000 and 2 <= power <= 10):
      raise ValueError(
          """Invalid input\n"""
          """needed_sum must be between 1 and 1000, power between 2 and 10."""					)

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


if __name__ == "__main__":
       import doctest

       doctest.testmod()





