
"""simple docstring"""





class __lowerCAmelCase				:




			"""simple docstring"""







			def __init__(				self						:					List[Any]       ,   _snake_case						:					list	)      -> str:







								"""simple docstring"""
								A_				 =						set_counts
								A_				 =						max(_snake_case	)
								A_				 =						len(_snake_case	)
								A_				 =						[1] * num_sets
								A_				 =						list(range(_snake_case	)	)




			def      lowerCamelCase__     (				self						:					Optional[Any]       ,   _snake_case						:					int       ,   _snake_case						:					int	)      -> str:







								"""simple docstring"""
								A_				 =						self.get_parent(_snake_case	)
								A_				 =						self.get_parent(_snake_case	)

								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]
													A_				 =						0
													A_				 =						dst_parent
													if self.ranks[dst_parent] == self.ranks[src_parent]:
																		self.ranks[dst_parent] += 1
													A_				 =						self.set_counts[dst_parent]
								else:
													self.set_counts[src_parent] += self.set_counts[dst_parent]
													A_				 =						0
													A_				 =						src_parent
													A_				 =						self.set_counts[src_parent]

								A_				 =						max(self.max_set       ,   _snake_case	)
								return True






			def      lowerCamelCase__     (				self						:					str       ,   _snake_case						:					int	)      -> str:







								"""simple docstring"""
								if self.parents[disj_set] == disj_set:
													return disj_set
								A_				 =						self.get_parent(self.parents[disj_set]	)
								return self.parents[disj_set]






"""simple docstring"""





import torch
def 							A_     ():

					'''simple docstring'''





					if torch.cuda.is_available():
										A_				 =						torch.cuda.device_count()
					else:
										A_				 =						0
					print(f'Successfully ran on {num_gpus} GPUs'				)


if __name__ == "__main__":
		main()




