




"""simple docstring"""
import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union

@dataclass
class __lowercase:




					'''simple docstring'''


					__a						:						Optional[Union[str, Path]]     		= None
					__a						:						bool     		= False
					__a						:						bool     		= False
					__a						:						bool     		= False
					__a						:						Optional[Dict]     		= None
					__a						:						Optional[str]     		= None
					__a						:						bool     		= False
					__a						:						bool     		= False
					__a						:						bool     		= False
					__a						:						bool     		= True
					__a						:						Optional[int]     		= None
					__a						:						int     		= 1
					__a						:						Optional[Union[str, bool]]     		= None
					__a						:						bool     		= False
					__a						:						Optional[Dict]     		= None
					__a						:						Optional[str]     		= None
					def     snake_case_				(    self     ):
								return self.__class__(**{k: copy.deepcopy(__a     ) for k, v in self.__dict__.items()}     )









"""simple docstring"""
def 						UpperCAmelCase				(			A__:    int							,				A__:    list[int]							,				A__:    int     )  ->     int:

			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:

			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]
						__lowerCamelCase					:	Dict	       =				sum(
						    count_of_possible_combinations_with_dp_array(target - item							,				A__     )
						    for item in array     )
						__lowerCamelCase					:	str	       =				answer
						return answer

			__lowerCamelCase					:	Union[str, Any]	       =				[-1] * (target + 1)
			return count_of_possible_combinations_with_dp_array(A__							,				A__     )





def 						UpperCAmelCase				(			A__:    int							,				A__:    list[int]							,				A__:    int     )  ->     int:
			__lowerCamelCase					:	int	       =				[0] * (target + 1)
			__lowerCamelCase					:	str	       =				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_				:    Any										=     3
					a_				:    str										=     5
					a_				:    List[Any]										=     [1, 2, 5]
					print(combination_sum_iv(n, array, target))



