





"""simple docstring"""





import math


def       a__					(					_SCREAMING_SNAKE_CASE    ):




		"""simple docstring"""


		UpperCamelCase   =	[True] * n
		UpperCamelCase   =	False
		UpperCamelCase   =	False
		UpperCamelCase   =	True

		for i in range(3  ,	int(n**0.5 + 1    )  ,	2    ):
				UpperCamelCase   =	i * 2
				while index < n:
						UpperCamelCase   =	False
						UpperCamelCase   =	index + i

		UpperCamelCase   =	[2]

		for i in range(3  ,	_SCREAMING_SNAKE_CASE  ,	2    ):
				if is_prime[i]:
						primes.append(_SCREAMING_SNAKE_CASE    )

		return primes


def       a__					(					_SCREAMING_SNAKE_CASE = 999_966_663_333    ):




		"""simple docstring"""


		UpperCamelCase   =	math.floor(math.sqrt(_SCREAMING_SNAKE_CASE    )    ) + 100
		UpperCamelCase   =	prime_sieve(_SCREAMING_SNAKE_CASE    )

		UpperCamelCase   =	0
		UpperCamelCase   =	0
		UpperCamelCase   =	primes[prime_index]

		while (last_prime**2) <= limit:
				UpperCamelCase   =	primes[prime_index + 1]

				UpperCamelCase   =	last_prime**2
				UpperCamelCase   =	next_prime**2

				# Get numbers divisible by lps(current)
				UpperCamelCase   =	lower_bound + last_prime
				while upper_bound > current <= limit:
						matches_sum += current
						current += last_prime

				# Reset the upper_bound
				while (upper_bound - next_prime) > limit:
						upper_bound -= next_prime

				# Add the numbers divisible by ups(current)
				UpperCamelCase   =	upper_bound - next_prime
				while current > lower_bound:
						matches_sum += current
						current -= next_prime

				# Remove the numbers divisible by both ups and lps
				UpperCamelCase   =	0
				while upper_bound > current <= limit:
						if current <= lower_bound:
								# Increment the current number
								current += last_prime * next_prime
								continue

						if current > limit:
								break

						# Remove twice since it was added by both ups and lps
						matches_sum -= current * 2

						# Increment the current number
						current += last_prime * next_prime

				# Setup for next pair
				UpperCamelCase   =	next_prime
				prime_index += 1

		return matches_sum


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













"""simple docstring"""





import unittest

from huggingface_hub import hf_hub_download

from transformers import MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING, VideoMAEFeatureExtractor
from transformers.pipelines import VideoClassificationPipeline, pipeline
from transformers.testing_utils import (
    is_pipeline_test,
    nested_simplify,
    require_decord,
    require_tf,
    require_torch,
    require_torch_or_tf,
    require_vision,
)

from .test_pipelines_common import ANY





@is_pipeline_test
@require_torch_or_tf
@require_vision
@require_decord
class        _lowerCamelCase      (       unittest.TestCase ):
						UpperCAmelCase_ =			MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING


						def     snake_case_   (self   ,							__a   ,							__a   ,							__a		) ->   str:
								UpperCamelCase   =	hf_hub_download(
								    repo_id="nateraw/video-demo"   ,							filename="archery.mp4"   ,							repo_type="dataset"		)
								UpperCamelCase   =	VideoClassificationPipeline(model=__a   ,							image_processor=__a   ,							top_k=2		)
								UpperCamelCase   =	[
								    example_video_filepath,
								    "https://huggingface.co/datasets/nateraw/video-demo/resolve/main/archery.mp4",
								]
								return video_classifier, examples


						def     snake_case_   (self   ,							__a   ,							__a		) ->   str:
								for example in examples:
										UpperCamelCase   =	video_classifier(__a		)

										self.assertEqual(
										    __a   ,							[
										        {"score": ANY(__a		), "label": ANY(__a		)},
										        {"score": ANY(__a		), "label": ANY(__a		)},
										    ]   ,							)


						@require_torch
						def     snake_case_   (self		) ->   int:
								UpperCamelCase   =	"hf-internal-testing/tiny-random-VideoMAEForVideoClassification"
								UpperCamelCase   =	VideoMAEFeatureExtractor(
								    size={"shortest_edge": 10}   ,							crop_size={"height": 10, "width": 10}		)
								UpperCamelCase   =	pipeline(
								    "video-classification"   ,							model=__a   ,							feature_extractor=__a   ,							frame_sampling_rate=4		)

								UpperCamelCase   =	hf_hub_download(repo_id="nateraw/video-demo"   ,							filename="archery.mp4"   ,							repo_type="dataset"		)
								UpperCamelCase   =	video_classifier(__a   ,							top_k=2		)
								self.assertEqual(
								    nested_simplify(__a   ,							decimals=4		)   ,							[{"score": 0.5199, "label": "LABEL_0"}, {"score": 0.4801, "label": "LABEL_1"}]   ,							)

								UpperCamelCase   =	video_classifier(
								    [
								        video_file_path,
								        video_file_path,
								    ]   ,							top_k=2   ,							)
								self.assertEqual(
								    nested_simplify(__a   ,							decimals=4		)   ,							[
								        [{"score": 0.5199, "label": "LABEL_0"}, {"score": 0.4801, "label": "LABEL_1"}],
								        [{"score": 0.5199, "label": "LABEL_0"}, {"score": 0.4801, "label": "LABEL_1"}],
								    ]   ,							)




						@require_tf
						def     snake_case_   (self		) ->   Optional[Any]:
								pass






