




'''simple docstring'''





from math import pow


def      UpperCamelCase_(	snake_case							:       int							,				snake_case							:       int							,				snake_case							:       int							,				snake_case							:       int							,				snake_case							:       int							,				):

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

							snake_case_						=      int(pow(snake_case							,				snake_case     )     )
							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_						=      backtrack(
														    snake_case							,				snake_case							,				current_number + 1							,				snake_case							,				snake_case     )
														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_						=      backtrack(
														    snake_case							,				snake_case							,				current_number + 1							,				snake_case							,				snake_case     )
							return current_sum, solutions_count


def      UpperCamelCase_(	snake_case							:       int							,				snake_case							:       int     ):

							'''simple docstring'''






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

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


if __name__ == "__main__":
		import doctest

		doctest.testmod()











'''simple docstring'''




from __future__ import annotations

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






def        _lowerCAmelCase			(  __snake_case  : float ,							__snake_case  : float ,							__snake_case  : bool = False			)     ->     list[float]:
     if radian_mode:
          return [magnitude * cos(__snake_case			), magnitude * sin(__snake_case			)]
     return [magnitude * cos(radians(__snake_case			)			), magnitude * sin(radians(__snake_case			)			)]






def        _lowerCAmelCase			(  __snake_case  : NDArray[floataa] ,							__snake_case  : NDArray[floataa] ,							__snake_case  : float = 10**-1			)     ->     bool:
     __A						: NDArray[floataa]      =       cross(__snake_case ,							__snake_case			)
     __A						: float      =       sum(__snake_case			)
     return abs(__snake_case			) < eps


if __name__ == "__main__":
  # Test to check if it works
  lowercase__    :      List[Any]						=    array(
      [
          polar_force(718.4, 1_80 - 30),
          polar_force(879.54, 45),
          polar_force(1_00, -90),
      ]
  )

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

  assert in_static_equilibrium(forces, location)

  # Problem 1 in image_data/2D_problems.jpg
  lowercase__    :      Dict						=    array(
      [
          polar_force(30 * 9.81, 15),
          polar_force(2_15, 1_80 - 45),
          polar_force(2_64, 90 - 30),
      ]
  )

  lowercase__    :      Any						=    array([[0, 0], [0, 0], [0, 0]])

  assert in_static_equilibrium(forces, location)

  # Problem in image_data/2D_problems_1.jpg
  lowercase__    :      Optional[int]						=    array([[0, -20_00], [0, -12_00], [0, 1_56_00], [0, -1_24_00]])

  lowercase__    :      Optional[int]						=    array([[0, 0], [6, 0], [10, 0], [12, 0]])

  assert in_static_equilibrium(forces, location)

  import doctest

  doctest.testmod()