


class _lowerCamelCase:
       def __init__(					self,      lowerCamelCase)       ->   None:




           """simple docstring"""

           _lowercase       :							Any      		=		set_counts
           _lowercase       :							List[Any]      		=		max(lowerCamelCase)
           _lowercase       :							Dict      		=		len(lowerCamelCase)
           _lowercase       :							Dict      		=		[1] * num_sets
           _lowercase       :							Optional[int]      		=		list(range(lowerCamelCase))
       def 			UpperCamelCase     (					self,      lowerCamelCase,      lowerCamelCase)       ->   bool:




           """simple docstring"""

           _lowercase       :							List[Any]      		=		self.get_parent(lowerCamelCase)
           _lowercase       :							int      		=		self.get_parent(lowerCamelCase)

           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]
               _lowercase       :							Dict      		=		0
               _lowercase       :							List[str]      		=		dst_parent
               if self.ranks[dst_parent] == self.ranks[src_parent]:
                   self.ranks[dst_parent] += 1
               _lowercase       :							str      		=		self.set_counts[dst_parent]
           else:
               self.set_counts[src_parent] += self.set_counts[dst_parent]
               _lowercase       :							int      		=		0
               _lowercase       :							str      		=		src_parent
               _lowercase       :							List[Any]      		=		self.set_counts[src_parent]

           _lowercase       :							str      		=		max(self.max_set,      lowerCamelCase)
           return True




       def 			UpperCamelCase     (					self,      lowerCamelCase)       ->   int:




           """simple docstring"""

           if self.parents[disj_set] == disj_set:
               return disj_set
           _lowercase       :							Union[str, Any]      		=		self.get_parent(self.parents[disj_set])
           return self.parents[disj_set]






from __future__ import annotations

from math import ceil, floor, sqrt



def 				UpperCamelCase_(      lowerCamelCase_ = 200_0000 )    ->						int:
    _lowercase       :							list[int]      		=		[0]
    _lowercase       :							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
    _lowercase       :							int      		=		0
    # the area corresponding to the grid that gives the product closest to target
    _lowercase       :							int      		=		0
    # an estimate of b, using the quadratic formula
    _lowercase       :							float
    # the largest integer less than b_estimate
    _lowercase       :							int
    # the largest integer less than b_estimate
    _lowercase       :							int
    # the triangle number corresponding to b_floor
    _lowercase       :							int
    # the triangle number corresponding to b_ceil
    _lowercase       :							int

    for idx_a, triangle_a in enumerate(triangle_numbers[1:]							, 1 ):
        _lowercase       :							Optional[int]      		=		(-1 + sqrt(1 + 8 * target / triangle_a )) / 2
        _lowercase       :							List[str]      		=		floor(lowerCamelCase_ )
        _lowercase       :							Dict      		=		ceil(lowerCamelCase_ )
        _lowercase       :							List[str]      		=		triangle_numbers[b_floor]
        _lowercase       :							List[str]      		=		triangle_numbers[b_ceil]

        if abs(target - triangle_b_first_guess * triangle_a ) < abs(
            target - best_product ):
            _lowercase       :							Union[str, Any]      		=		triangle_b_first_guess * triangle_a
            _lowercase       :							Union[str, Any]      		=		idx_a * b_floor

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

    return area


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


