

def    __UpperCAmelCase (	__a      :			int		,__a      :			list[int]		,__a      :			int	)			->     int:

					"""simple docstring"""

					def count_of_possible_combinations(__a      :			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(__a	)



def    __UpperCAmelCase (	__a      :			int		,__a      :			list[int]		,__a      :			int	)			->     int:

					"""simple docstring"""

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

					_a	:    int         =		[-1] * (target + 1)
					return count_of_possible_combinations_with_dp_array(__a		,__a	)



def    __UpperCAmelCase (	__a      :			int		,__a      :			list[int]		,__a      :			int	)			->     int:

					"""simple docstring"""

					_a	:    str         =		[0] * (target + 1)
					_a	:    Optional[Any]         =		1

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

					return dp_array[target]


if __name__ == "__main__":
			import doctest

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






def    __UpperCAmelCase (	__a      :			int		,__a      :			list[int]		,__a      :			int	)			->     int:

					"""simple docstring"""

					def count_of_possible_combinations(__a      :			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(__a	)



def    __UpperCAmelCase (	__a      :			int		,__a      :			list[int]		,__a      :			int	)			->     int:

					"""simple docstring"""

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

					_a	:    int         =		[-1] * (target + 1)
					return count_of_possible_combinations_with_dp_array(__a		,__a	)



def    __UpperCAmelCase (	__a      :			int		,__a      :			list[int]		,__a      :			int	)			->     int:

					"""simple docstring"""

					_a	:    str         =		[0] * (target + 1)
					_a	:    Optional[Any]         =		1

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

					return dp_array[target]


if __name__ == "__main__":
			import doctest

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



