





def   __snake_case    (       _lowerCAmelCase			:			list[int]					,					_lowerCAmelCase			:			int						)			->    bool:
   A_       :					Optional[Any]        =      len(_lowerCAmelCase						)
   A_       :					int        =      [[False] * (required_sum + 1) for _ in range(arr_len + 1						)]

   # for each arr value, a sum of zero(0) can be formed by not taking any element
   # hence True/1
   for i in range(arr_len + 1						):
      A_       :					List[Any]        =      True

   # sum is not zero and set is empty then false
   for i in range(1					,					required_sum + 1						):
      A_       :					Optional[Any]        =      False

   for i in range(1					,					arr_len + 1						):
      for j in range(1					,					required_sum + 1						):
         if arr[i - 1] > j:
            A_       :					Optional[int]        =      subset[i - 1][j]
         if arr[i - 1] <= j:
            A_       :					int        =      subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]

   return subset[arr_len][required_sum]


if __name__ == "__main__":
 import doctest

 doctest.testmod()







from __future__ import annotations

def   __snake_case    (       _lowerCAmelCase			:			list[int]					,					_lowerCAmelCase			:			int						)			->    list[list[int]]:
   A_       :					list[list[int]]        =      []
   A_       :					list[int]        =      []
   A_       :					Dict        =      0
   A_       :					str        =      sum(_lowerCAmelCase						)
   create_state_space_tree(_lowerCAmelCase					,					_lowerCAmelCase					,					_lowerCAmelCase					,					_lowerCAmelCase					,					_lowerCAmelCase					,					_lowerCAmelCase						)
   return result

def   __snake_case    (       _lowerCAmelCase			:			list[int]					,					_lowerCAmelCase			:			int					,					_lowerCAmelCase			:			int					,					_lowerCAmelCase			:			list[int]					,					_lowerCAmelCase			:			list[list[int]]					,					_lowerCAmelCase			:			int					,					)			->    None:
   if sum(_lowerCAmelCase						) > max_sum or (remaining_nums_sum + sum(_lowerCAmelCase						)) < max_sum:
      return
   if sum(_lowerCAmelCase						) == max_sum:
      result.append(_lowerCAmelCase						)
      return
   for index in range(_lowerCAmelCase					,					len(_lowerCAmelCase						)						):
      create_state_space_tree(
          _lowerCAmelCase					,					_lowerCAmelCase					,					index + 1					,					[*path, nums[index]]					,					_lowerCAmelCase					,					remaining_nums_sum - nums[index]					,					)
_lowerCAmelCase				:   List[Any]						       =						[3, 34, 4, 12, 5, 2]
_lowerCAmelCase				:   Dict						       =						9
_lowerCAmelCase				:   Dict						       =						generate_sum_of_subsets_soln(nums, max_sum)





print(*result)
