



'''simple docstring'''



from math import isqrt
def 					UpperCAmelCase   (						A  :				int				):
							SCREAMING_SNAKE_CASE					:      Union[str, Any]     					=			[True] * max_number
							for i in range(2					,		isqrt(max_number - 1				) + 1				):
														if is_prime[i]:
																					for j in range(i**2					,		A					,		A				):
																												SCREAMING_SNAKE_CASE					:      Optional[Any]     					=			False

							return [i for i in range(2					,		A				) if is_prime[i]]
def 					UpperCAmelCase   (						A  :				int = 10**8				):
							SCREAMING_SNAKE_CASE					:      List[Any]     					=			calculate_prime_numbers(max_number // 2				)

							SCREAMING_SNAKE_CASE					:      List[str]     					=			0
							SCREAMING_SNAKE_CASE					:      str     					=			0
							SCREAMING_SNAKE_CASE					:      Tuple     					=			len(A				) - 1
							while left <= right:
														while prime_numbers[left] * prime_numbers[right] >= max_number:
																					right -= 1
														semiprimes_count += right - left + 1
														left += 1

							return semiprimes_count


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









'''simple docstring'''



from bisect import bisect
from itertools import accumulate
def 					UpperCAmelCase   (						A  :				Tuple					,		A  :				Optional[Any]					,		A  :				Dict					,		A  :				Any				):
							SCREAMING_SNAKE_CASE					:      List[str]     					=			sorted(zip(A					,		A				)					,		key=lambda A				: x[0] / x[1]					,		reverse=A				)
							SCREAMING_SNAKE_CASE					,SCREAMING_SNAKE_CASE					:      Dict     					=			[i[0] for i in r], [i[1] for i in r]
							SCREAMING_SNAKE_CASE					:      Union[str, Any]     					=			list(accumulate(A				)				)
							SCREAMING_SNAKE_CASE					:      List[Any]     					=			bisect(A					,		A				)
							return (
							    0
							    if k == 0
							    else sum(vl[:k]				) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
							    if k != n
							    else sum(vl[:k]				)
							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()




