'''simple docstring'''

from __future__ import annotations

from collections.abc import Generator
def       __UpperCamelCase	(       ):
 lowercase__    :   Optional[int]						= {}
 lowercase__    :   Optional[int]						= 2
 while True:
  lowercase__    :   Optional[int]						= factor_map.pop(UpperCAmelCase_		,					UpperCAmelCase_					)
  if factor:
   lowercase__    :   Union[str, Any]						= factor + prime
   while x in factor_map:
    x += factor
   lowercase__    :   Tuple						= factor
  else:
   lowercase__    :   Dict						= prime
   yield prime
  prime += 1
def       __UpperCamelCase	(       UpperCAmelCase = 1E10					):
 lowercase__    :   Tuple						= sieve()

 lowercase__    :   Union[str, Any]						= 1
 while True:
  lowercase__    :   int						= next(UpperCAmelCase_					)
  if (2 * prime * n) > limit:
   return n
  # Ignore the next prime as the reminder will be 2.
  next(UpperCAmelCase_					)
  n += 2


if __name__ == "__main__":
  print(solution())


'''simple docstring'''

import pytest

import datasets.config
from datasets.utils.info_utils import is_small_dataset
@pytest.mark.parametrize('''dataset_size'''		,					[None, 400 * 2**20, 600 * 2**20]					)
@pytest.mark.parametrize('''input_in_memory_max_size'''		,					['''default''', 0, 100 * 2**20, 900 * 2**20]					)
def       __UpperCamelCase	(       UpperCAmelCase		,					UpperCAmelCase		,					UpperCAmelCase					):
 if input_in_memory_max_size != "default":
  monkeypatch.setattr(datasets.config		,					'''IN_MEMORY_MAX_SIZE'''		,					UpperCAmelCase					)
 lowercase__    :   List[Any]						= datasets.config.IN_MEMORY_MAX_SIZE
 if input_in_memory_max_size == "default":
  assert in_memory_max_size == 0
 else:
  assert in_memory_max_size == input_in_memory_max_size
 if dataset_size and in_memory_max_size:
  lowercase__    :   str						= dataset_size < in_memory_max_size
 else:
  lowercase__    :   Optional[int]						= False
 lowercase__    :   Optional[Any]						= is_small_dataset(UpperCAmelCase					)
 assert result == expected

