






def      lowercase__      (     __snake_case    :							int     ,       __snake_case    :							list[int]     ,       __snake_case    :							int  ):


					'''simple docstring'''


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




def      lowercase__      (     __snake_case    :							int     ,       __snake_case    :							list[int]     ,       __snake_case    :							int  ):


					'''simple docstring'''


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

					UpperCAmelCase_    :      Tuple            =						[-1] * (target + 1)
					return count_of_possible_combinations_with_dp_array(__snake_case     ,       __snake_case  )




def      lowercase__      (     __snake_case    :							int     ,       __snake_case    :							list[int]     ,       __snake_case    :							int  ):


					'''simple docstring'''


					UpperCAmelCase_    :      List[str]            =						[0] * (target + 1)
					UpperCAmelCase_    :      List[str]            =						1

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

					return dp_array[target]


if __name__ == "__main__":
		import doctest

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














import os

# Precomputes a list of the 100 first triangular numbers
__UpperCAmelCase								=						[int(0.5 * n * (n + 1)) for n in range(1, 101)]




def      lowercase__      (     ):


					'''simple docstring'''


					UpperCAmelCase_    :      Any            =						os.path.dirname(os.path.realpath(__snake_case  )  )
					UpperCAmelCase_    :      Optional[Any]            =						os.path.join(__snake_case     ,       'words.txt'  )

					UpperCAmelCase_    :      Union[str, Any]            =						''
					with open(__snake_case  ) as f:
										UpperCAmelCase_    :      List[Any]            =						f.readline()

					UpperCAmelCase_    :      Optional[int]            =						[word.strip('"'  ) for word in words.strip('\r\n'  ).split(','  )]
					UpperCAmelCase_    :      Optional[int]            =						[
					    word
					    for word in [sum(ord(__snake_case  ) - 64 for x in word  ) for word in words]
					    if word in TRIANGULAR_NUMBERS
					]
					return len(__snake_case  )


if __name__ == "__main__":
		print(solution())






