
"""simple docstring"""

def 							A						(    snake_case				:int    , snake_case				:list[int]    , snake_case				:int		)				->     int:

 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 							A						(    snake_case				:int    , snake_case				:list[int]    , snake_case				:int		)				->     int:

 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      =	sum(
      count_of_possible_combinations_with_dp_array(target - item    , snake_case		)
      for item in array		)
  __UpperCamelCase      =	answer
  return answer

 __UpperCamelCase      =	[-1] * (target + 1)
 return count_of_possible_combinations_with_dp_array(snake_case    , snake_case		)






def 							A						(    snake_case				:int    , snake_case				:list[int]    , snake_case				:int		)				->     int:
 __UpperCamelCase      =	[0] * (target + 1)
 __UpperCamelCase      =	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     :    List[str]       =			3
      UpperCamelCase     :    Union[str, Any]       =			5
      UpperCamelCase     :    List[str]       =			[1, 2, 5]
      print(combination_sum_iv(n, array, target))





"""simple docstring"""

def 							A						(    snake_case				:int		)				->     bool:
 return sum(i for i in range(1    , number // 2 + 1		) if number % i == 0		) == number


if __name__ == "__main__":
      print("Program to check whether a number is a Perfect number or not...")
      UpperCamelCase     :    Union[str, Any]       =			int(input("Enter number: ").strip())
      print(f'''{number} is {"" if perfect(number) else "not "}a Perfect Number.''')



