

from itertools import compress, repeat
from math import ceil, sqrt


def  __a    (				SCREAMING_SNAKE_CASE ) ->       list[int]:






				'''simple docstring'''



				if num <= 2:
								return []
				if num == 3:
								return [2]

				# Odd sieve for numbers in range [3, num - 1]
				__UpperCAmelCase			   =     bytearray(b'''\x01''' ) * ((num >> 1) - 1)

				for i in range(3    ,				int(sqrt(UpperCamelCase_ ) ) + 1    ,				2 ):
								if sieve[(i >> 1) - 1]:
												__UpperCAmelCase			   =     i**2
												__UpperCAmelCase			   =     repeat(
												    0    ,				ceil((num - i_squared) / (i << 1) ) )

				return [2] + list(compress(range(3    ,				UpperCamelCase_    ,				2 )    ,				UpperCamelCase_ ) )


if __name__ == "__main__":
							import doctest

							doctest.testmod()







from dataclasses import dataclass
from typing import Callable, Optional

import datasets
@dataclass
class    A_				( datasets.BuilderConfig  ):


    '''simple docstring'''






    a__       							=    None
    a__       							=    None
    a__       							=    None


    def        lowerCAmelCase_  (self					)       -> Dict:
        assert self.generator is not None, "generator must be specified"

        if self.gen_kwargs is None:
            __UpperCAmelCase			   =     {}






class    A_				( datasets.GeneratorBasedBuilder  ):


    '''simple docstring'''






    a__       							=    GeneratorConfig


    def        lowerCAmelCase_  (self					)       -> Dict:
        return datasets.DatasetInfo(features=self.config.features					)


    def        lowerCAmelCase_  (self       , lowercase__					)       -> List[str]:
        return [datasets.SplitGenerator(name=datasets.Split.TRAIN       , gen_kwargs=self.config.gen_kwargs					)]






    def        lowerCAmelCase_  (self       , **lowercase__					)       -> str:
        for idx, ex in enumerate(self.config.generator(**lowercase__					)					):
            yield idx, ex




