





'''simple docstring'''






from __future__ import annotations

from math import ceil, floor, sqrt





def       lowercase_      (		lowercase__ = 200_0000						)   ->int:
      _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:   Any  					=		(-1 + sqrt(1 + 8 * target / triangle_a						)) / 2
            _snake_case:   str  					=		floor(lowercase__						)
            _snake_case:   Union[str, Any]  					=		ceil(lowercase__						)
            _snake_case:   Dict  					=		triangle_numbers[b_floor]
            _snake_case:   Any  					=		triangle_numbers[b_ceil]

            if abs(target - triangle_b_first_guess * triangle_a						) < abs(
                target - best_product						):
                  _snake_case:   Dict  					=		triangle_b_first_guess * triangle_a
                  _snake_case:   Optional[Any]  					=		idx_a * b_floor

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

      return area


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












'''simple docstring'''






from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

A   : str             =			TypeVar('T')







class 			lowerCamelCase					(						Generic[T]  ):
					_SCREAMING_SNAKE_CASE							   =    42  # Cache store of keys
					_SCREAMING_SNAKE_CASE							   =    42  # References of the keys in cache
					_SCREAMING_SNAKE_CASE							   =    10  # Maximum capacity of cache


					def __init__(					self	:  List[Any]       ,     __snake_case	:  int       ):





											'''simple docstring'''





											_snake_case:   Dict  					=		deque()
											_snake_case:   Union[str, Any]  					=		set()
											if not n:
																	_snake_case:   Optional[int]  					=		sys.maxsize
											elif n < 0:
																	raise ValueError('n should be an integer greater than 0.'       )
											else:
																	_snake_case:   Tuple  					=		n


					def    SCREAMING_SNAKE_CASE_		(					self	:  Any       ,     __snake_case	:  T       ):





											'''simple docstring'''





											if x not in self.key_reference:
																	if len(self.dq_store       ) == LRUCache._MAX_CAPACITY:
																							_snake_case:   int  					=		self.dq_store.pop()
																							self.key_reference.remove(__snake_case       )
											else:
																	self.dq_store.remove(__snake_case       )

											self.dq_store.appendleft(__snake_case       )
											self.key_reference.add(__snake_case       )


					def    SCREAMING_SNAKE_CASE_		(					self	:  int       ):





											'''simple docstring'''





											for k in self.dq_store:
																	print(__snake_case       )




					def __repr__(					self	:  List[Any]       ):





											'''simple docstring'''





											return f'''LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store       )}'''


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		A   : LRUCache[str | int]             =			LRUCache(4)
		lru_cache.refer('A')
		lru_cache.refer(2)
		lru_cache.refer(3)
		lru_cache.refer('A')
		lru_cache.refer(4)
		lru_cache.refer(5)
		lru_cache.display()

		print(lru_cache)
		assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"





