


'''simple docstring'''

from __future__ import annotations

from math import ceil, floor, sqrt

def _SCREAMING_SNAKE_CASE (A = 2_000_000			)			->			int:






       """simple docstring"""







       lowercase__      =					[0]
       lowercase__      =					42

       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__      =					0
       # the area corresponding to the grid that gives the product closest to target
       lowercase__      =					0
       # an estimate of b, using the quadratic formula
       lowercase__      =					42
       # the largest integer less than b_estimate
       lowercase__      =					42
       # the largest integer less than b_estimate
       lowercase__      =					42
       # the triangle number corresponding to b_floor
       lowercase__      =					42
       # the triangle number corresponding to b_ceil
       lowercase__      =					42

       for idx_a, triangle_a in enumerate(triangle_numbers[1:]    ,					1			):
              lowercase__      =					(-1 + sqrt(1 + 8 * target / triangle_a			)) / 2
              lowercase__      =					floor(_UpperCamelCase			)
              lowercase__      =					ceil(_UpperCamelCase			)
              lowercase__      =					triangle_numbers[b_floor]
              lowercase__      =					triangle_numbers[b_ceil]

              if abs(target - triangle_b_first_guess * triangle_a			) < abs(
                  target - best_product			):
                     lowercase__      =					triangle_b_first_guess * triangle_a
                     lowercase__      =					idx_a * b_floor

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

       return area


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







import math


def 							__lowerCAmelCase     (							_UpperCamelCase		:	int						)		->				list[int]:
 '''simple docstring'''


 SCREAMING_SNAKE_CASE		    =      []
 SCREAMING_SNAKE_CASE		    =      2
 SCREAMING_SNAKE_CASE		    =      int(math.sqrt(_UpperCamelCase						)						)  # Size of every segment
 SCREAMING_SNAKE_CASE		    =      [True] * (end + 1)
 SCREAMING_SNAKE_CASE		    =      []

 while start <= end:
  if temp[start] is True:
   in_prime.append(_UpperCamelCase						)
   for i in range(start * start		,				end + 1		,				_UpperCamelCase						):
    SCREAMING_SNAKE_CASE		    =      False
  start += 1
 prime += in_prime

 SCREAMING_SNAKE_CASE		    =      end + 1
 SCREAMING_SNAKE_CASE		    =      min(2 * end		,				_UpperCamelCase						)

 while low <= n:
  SCREAMING_SNAKE_CASE		    =      [True] * (high - low + 1)
  for each in in_prime:
   SCREAMING_SNAKE_CASE		    =      math.floor(low / each						) * each
   if t < low:
    t += each

   for j in range(_UpperCamelCase		,				high + 1		,				_UpperCamelCase						):
    SCREAMING_SNAKE_CASE		    =      False

  for j in range(len(_UpperCamelCase						)						):
   if temp[j] is True:
    prime.append(j + low						)

  SCREAMING_SNAKE_CASE		    =      high + 1
  SCREAMING_SNAKE_CASE		    =      min(high + end		,				_UpperCamelCase						)

 return prime




print(sieve(10**6))

