






class 				_A			:
    """simple docstring"""

    def __init__(				self      :     Dict ,     __SCREAMING_SNAKE_CASE      :     list      )      ->							None:
           __UpperCAmelCase     				=set_counts
           __UpperCAmelCase     				=max(__SCREAMING_SNAKE_CASE      )
           __UpperCAmelCase     				=len(__SCREAMING_SNAKE_CASE      )
           __UpperCAmelCase     				=[1] * num_sets
           __UpperCAmelCase     				=list(range(__SCREAMING_SNAKE_CASE      )      )



    def _a							(				self      :     Optional[Any] ,     __SCREAMING_SNAKE_CASE      :     int ,     __SCREAMING_SNAKE_CASE      :     int      )      ->							bool:
           __UpperCAmelCase     				=self.get_parent(__SCREAMING_SNAKE_CASE      )
           __UpperCAmelCase     				=self.get_parent(__SCREAMING_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]
                  __UpperCAmelCase     				=0
                  __UpperCAmelCase     				=dst_parent
                  if self.ranks[dst_parent] == self.ranks[src_parent]:
                         self.ranks[dst_parent] += 1
                  __UpperCAmelCase     				=self.set_counts[dst_parent]
           else:
                  self.set_counts[src_parent] += self.set_counts[dst_parent]
                  __UpperCAmelCase     				=0
                  __UpperCAmelCase     				=src_parent
                  __UpperCAmelCase     				=self.set_counts[src_parent]

           __UpperCAmelCase     				=max(self.max_set ,     __SCREAMING_SNAKE_CASE      )
           return True



    def _a							(				self      :     List[str] ,     __SCREAMING_SNAKE_CASE      :     int      )      ->							int:
           if self.parents[disj_set] == disj_set:
                  return disj_set
           __UpperCAmelCase     				=self.get_parent(self.parents[disj_set]      )
           return self.parents[disj_set]






'''simple docstring'''
from __future__ import annotations

from math import ceil, floor, sqrt




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ = 200_0000			)  ->							int:


		'''simple docstring'''


		snake_case  :       list[int]     			=						[0]
		snake_case  :       int

		for idx in range(1 ,       ceil(sqrt(target * 2			) * 1.1			)			):
				triangle_numbers.append(triangle_numbers[-1] + idx			)

		# we want this to be as close as possible to target
		snake_case  :       int     			=						0
		# the area corresponding to the grid that gives the product closest to target
		snake_case  :       int     			=						0
		# an estimate of b, using the quadratic formula
		snake_case  :       float
		# the largest integer less than b_estimate
		snake_case  :       int
		# the largest integer less than b_estimate
		snake_case  :       int
		# the triangle number corresponding to b_floor
		snake_case  :       int
		# the triangle number corresponding to b_ceil
		snake_case  :       int

		for idx_a, triangle_a in enumerate(triangle_numbers[1:] ,       1			):
				snake_case  :       int     			=						(-1 + sqrt(1 + 8 * target / triangle_a			)) / 2
				snake_case  :       Optional[int]     			=						floor(SCREAMING_SNAKE_CASE__			)
				snake_case  :       int     			=						ceil(SCREAMING_SNAKE_CASE__			)
				snake_case  :       Optional[Any]     			=						triangle_numbers[b_floor]
				snake_case  :       Union[str, Any]     			=						triangle_numbers[b_ceil]

				if abs(target - triangle_b_first_guess * triangle_a			) < abs(
				    target - best_product			):
						snake_case  :       str     			=						triangle_b_first_guess * triangle_a
						snake_case  :       int     			=						idx_a * b_floor

				if abs(target - triangle_b_second_guess * triangle_a			) < abs(
				    target - best_product			):
						snake_case  :       List[Any]     			=						triangle_b_second_guess * triangle_a
						snake_case  :       Any     			=						idx_a * b_ceil

		return area


if __name__ == "__main__":
						print(f"{solution() = }")


