'''simple docstring'''




def _lowercase	(      lowerCamelCase__						)					->       Optional[int]:





       """simple docstring"""


       __UpperCAmelCase  :				Union[str, Any]       				=		len(lowerCamelCase__						)
       __UpperCAmelCase  :				List[str]       				=		sum(lowerCamelCase__						)

       __UpperCAmelCase  :				Any       				=		[[False for x in range(s + 1						)] for y in range(n + 1						)]

       for i in range(1							,    n + 1						):
              __UpperCAmelCase  :				Union[str, Any]       				=		True

       for i in range(1							,    s + 1						):
              __UpperCAmelCase  :				Dict       				=		False

       for i in range(1							,    n + 1						):
              for j in range(1							,    s + 1						):
                     __UpperCAmelCase  :				Tuple       				=		dp[i][j - 1]

                     if arr[i - 1] <= j:
                            __UpperCAmelCase  :				str       				=		dp[i][j] or dp[i - 1][j - arr[i - 1]]

       for j in range(int(s / 2						)							,    -1							,    -1						):
              if dp[n][j] is True:
                     __UpperCAmelCase  :				Dict       				=		s - 2 * j
                     break

       return diff







'''simple docstring'''




class 		__A       :






       def __init__(      self				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				Any       				=		set_counts
              __UpperCAmelCase  :				int       				=		max(UpperCamelCase_      )
              __UpperCAmelCase  :				List[str]       				=		len(UpperCamelCase_      )
              __UpperCAmelCase  :				Any       				=		[1] * num_sets
              __UpperCAmelCase  :				Any       				=		list(range(UpperCamelCase_      )      )






       def 			_snake_case						(      self				,     UpperCamelCase_				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				Optional[int]       				=		self.get_parent(UpperCamelCase_      )
              __UpperCAmelCase  :				List[Any]       				=		self.get_parent(UpperCamelCase_      )

              if src_parent == dst_parent:
                     return False

              if self.ranks[dst_parent] >= self.ranks[src_parent]:
                     self.set_counts[dst_parent] += self.set_counts[src_parent]
                     __UpperCAmelCase  :				Optional[Any]       				=		0
                     __UpperCAmelCase  :				List[Any]       				=		dst_parent
                     if self.ranks[dst_parent] == self.ranks[src_parent]:
                            self.ranks[dst_parent] += 1
                     __UpperCAmelCase  :				Union[str, Any]       				=		self.set_counts[dst_parent]
              else:
                     self.set_counts[src_parent] += self.set_counts[dst_parent]
                     __UpperCAmelCase  :				Union[str, Any]       				=		0
                     __UpperCAmelCase  :				Dict       				=		src_parent
                     __UpperCAmelCase  :				Dict       				=		self.set_counts[src_parent]

              __UpperCAmelCase  :				Dict       				=		max(self.max_set				,     UpperCamelCase_      )
              return True







       def 			_snake_case						(      self				,     UpperCamelCase_      ):
              if self.parents[disj_set] == disj_set:
                     return disj_set
              __UpperCAmelCase  :				str       				=		self.get_parent(self.parents[disj_set]      )
              return self.parents[disj_set]






