


from __future__ import annotations

from numpy import array, cos, cross, floataa, radians, sin
from numpy.typing import NDArray







def        SCREAMING_SNAKE_CASE_						(			__A :			Optional[int]  ,    __A :			Optional[Any]  ,    __A :			Optional[int] = False				)	->		Tuple:

       """simple docstring"""

       if radian_mode:
              return [magnitude * cos(lowerCamelCase__				), magnitude * sin(lowerCamelCase__				)]
       return [magnitude * cos(radians(lowerCamelCase__				)				), magnitude * sin(radians(lowerCamelCase__				)				)]







def        SCREAMING_SNAKE_CASE_						(			__A :			str  ,    __A :			Dict  ,    __A :			Tuple = 10**-1				)	->		int:

       """simple docstring"""

       a_					:		NDArray[floataa]							=  cross(lowerCamelCase__  ,    lowerCamelCase__				)
       a_					:		float							=  sum(lowerCamelCase__				)
       return abs(lowerCamelCase__				) < eps


if __name__ == "__main__":
   # Test to check if it works
   UpperCAmelCase_      : List[str]  					=       array(
       [
           polar_force(7_1_8.4, 180 - 30),
           polar_force(8_7_9.5_4, 45),
           polar_force(100, -90),
       ]
   )

   UpperCAmelCase_      : NDArray[floataa]  					=       array([[0, 0], [0, 0], [0, 0]])

   assert in_static_equilibrium(forces, location)

   # Problem 1 in image_data/2D_problems.jpg
   UpperCAmelCase_      : Union[str, Any]  					=       array(
       [
           polar_force(30 * 9.8_1, 15),
           polar_force(215, 180 - 45),
           polar_force(264, 90 - 30),
       ]
   )

   UpperCAmelCase_      : List[str]  					=       array([[0, 0], [0, 0], [0, 0]])

   assert in_static_equilibrium(forces, location)

   # Problem in image_data/2D_problems_1.jpg
   UpperCAmelCase_      : Tuple  					=       array([[0, -2000], [0, -1200], [0, 1_5600], [0, -1_2400]])

   UpperCAmelCase_      : Union[str, Any]  					=       array([[0, 0], [6, 0], [10, 0], [12, 0]])

   assert in_static_equilibrium(forces, location)

   import doctest

   doctest.testmod()







'''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()