


'''simple docstring'''






from math import isclose, sqrt





def lowerCamelCase__      (						__lowerCamelCase	:							float	,   __lowerCamelCase	:							float	,   __lowerCamelCase	:							float							):







   '''simple docstring'''




   _UpperCAmelCase       :       Any							   =point_y / 4 / point_x
   _UpperCAmelCase       :       Union[str, Any]							   =2 * normal_gradient / (1 + normal_gradient * normal_gradient)
   _UpperCAmelCase       :       Dict							   =(1 - normal_gradient * normal_gradient) / (
       1 + normal_gradient * normal_gradient
   )
   _UpperCAmelCase       :       Optional[Any]							   =(sa - ca * incoming_gradient) / (ca + sa * incoming_gradient)

   # to find the next point, solve the simultaeneous equations:
   # y^2 + 4x^2 = 100
   # y - b = m * (x - a)
   # ==> A x^2 + B x + C = 0
   _UpperCAmelCase       :       int							   =outgoing_gradient**2 + 4
   _UpperCAmelCase       :       Optional[int]							   =2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
   _UpperCAmelCase       :       Optional[int]							   =(point_y - outgoing_gradient * point_x) ** 2 - 1_0_0

   _UpperCAmelCase       :       Optional[Any]							   =(
       -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term							)
   ) / (2 * quadratic_term)
   _UpperCAmelCase       :       List[str]							   =(
       -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term							)
   ) / (2 * quadratic_term)

   # two solutions, one of which is our input point
   _UpperCAmelCase       :       Union[str, Any]							   =x_minus if isclose(__lowerCamelCase	,   __lowerCamelCase							) else x_plus
   _UpperCAmelCase       :       List[Any]							   =point_y + outgoing_gradient * (next_x - point_x)

   return next_x, next_y, outgoing_gradient





def lowerCamelCase__      (						__lowerCamelCase	:							float = 1.4	,   __lowerCamelCase	:							float = -9.6							):







   '''simple docstring'''




   _UpperCAmelCase       :       int							   =0
   _UpperCAmelCase       :       float							   =first_x_coord
   _UpperCAmelCase       :       float							   =first_y_coord
   _UpperCAmelCase       :       float							   =(10.1 - point_y) / (0.0 - point_x)

   while not (-0.01 <= point_x <= 0.01 and point_y > 0):
      _UpperCAmelCase   ,	_UpperCAmelCase   ,	_UpperCAmelCase       :       Optional[int]							   =next_point(__lowerCamelCase	,   __lowerCamelCase	,   __lowerCamelCase							)
      num_reflections += 1

   return num_reflections


if __name__ == "__main__":
 print(F"""{solution() = }""")





'''simple docstring'''






def lowerCamelCase__      (						__lowerCamelCase	:							int	,   __lowerCamelCase	:							list[int]	,   __lowerCamelCase	:							int							):







   '''simple docstring'''




   def count_of_possible_combinations(__lowerCamelCase	:							int							) -> int:
      if target < 0:
         return 0
      if target == 0:
         return 1
      return sum(count_of_possible_combinations(target - item							) for item in array							)

   return count_of_possible_combinations(__lowerCamelCase							)





def lowerCamelCase__      (						__lowerCamelCase	:							int	,   __lowerCamelCase	:							list[int]	,   __lowerCamelCase	:							int							):







   '''simple docstring'''




   def count_of_possible_combinations_with_dp_array(
       __lowerCamelCase	:							int	,   __lowerCamelCase	:							list[int]							) -> int:
      if target < 0:
         return 0
      if target == 0:
         return 1
      if dp_array[target] != -1:
         return dp_array[target]
      _UpperCAmelCase       :       str							   =sum(
          count_of_possible_combinations_with_dp_array(target - item	,   __lowerCamelCase							)
          for item in array							)
      _UpperCAmelCase       :       Optional[Any]							   =answer
      return answer

   _UpperCAmelCase       :       int							   =[-1] * (target + 1)
   return count_of_possible_combinations_with_dp_array(__lowerCamelCase	,   __lowerCamelCase							)





def lowerCamelCase__      (						__lowerCamelCase	:							int	,   __lowerCamelCase	:							list[int]	,   __lowerCamelCase	:							int							):







   '''simple docstring'''




   _UpperCAmelCase       :       Tuple							   =[0] * (target + 1)
   _UpperCAmelCase       :       Dict							   =1

   for i in range(1	,   target + 1							):
      for j in range(__lowerCamelCase							):
         if i - array[j] >= 0:
            dp_array[i] += dp_array[i - array[j]]

   return dp_array[target]


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 lowercase							=3
 lowercase							=5
 lowercase							=[1, 2, 5]
 print(combination_sum_iv(n, array, target))

