



class SCREAMING_SNAKE_CASE__     :  # Public class to implement a graph




    '''simple docstring'''






    def __init__(       self,		lowerCamelCase__,		lowerCamelCase__,		lowerCamelCase__		):
        A :       Union[str, Any]          =   row
        A :       str          =   col
        A :       Optional[Any]          =   graph






    def 			_lowerCAmelCase					(       self,		lowerCamelCase__,		lowerCamelCase__,		lowerCamelCase__		):
        return (
            0 <= i < self.ROW
            and 0 <= j < self.COL
            and not visited[i][j]
            and self.graph[i][j]
        )






    def 			_lowerCAmelCase					(       self,		lowerCamelCase__,		lowerCamelCase__,		lowerCamelCase__		):
        # Checking all 8 elements surrounding nth element
        A :       str          =   [-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
        A :       str          =   [-1, 0, 1, -1, 1, -1, 0, 1]
        A :       Any          =   True  # Make those cells visited
        for k in range(8		):
            if self.is_safe(i + row_nbr[k],		j + col_nbr[k],		lowerCamelCase__		):
                self.diffs(i + row_nbr[k],		j + col_nbr[k],		lowerCamelCase__		)






    def 			_lowerCAmelCase					(       self		):  # And finally, count all islands.
        A :       Optional[int]          =   [[False for j in range(self.COL		)] for i in range(self.ROW		)]
        A :       List[str]          =   0
        for i in range(self.ROW		):
            for j in range(self.COL		):
                if visited[i][j] is False and self.graph[i][j] == 1:
                    self.diffs(lowerCamelCase__,		lowerCamelCase__,		lowerCamelCase__		)
                    count += 1
        return count







from __future__ import annotations

from math import ceil, floor, sqrt




def 	__UpperCamelCase	(  _lowerCAmelCase = 200_0000		)       ->  int:



    """simple docstring"""






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

    for idx_a, triangle_a in enumerate(triangle_numbers[1:]      ,     1		):
        A :       Union[str, Any]          =   (-1 + sqrt(1 + 8 * target / triangle_a		)) / 2
        A :       List[Any]          =   floor(_lowerCAmelCase		)
        A :       Tuple          =   ceil(_lowerCAmelCase		)
        A :       int          =   triangle_numbers[b_floor]
        A :       Dict          =   triangle_numbers[b_ceil]

        if abs(target - triangle_b_first_guess * triangle_a		) < abs(
            target - best_product		):
            A :       Optional[int]          =   triangle_b_first_guess * triangle_a
            A :       Optional[int]          =   idx_a * b_floor

        if abs(target - triangle_b_second_guess * triangle_a		) < abs(
            target - best_product		):
            A :       Tuple          =   triangle_b_second_guess * triangle_a
            A :       Tuple          =   idx_a * b_ceil

    return area


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


