




'''simple docstring'''




def      __snake_case       (   lowercase   :							str			, lowercase   :							Tuple  ):
					snake_case_	=      0
					snake_case_	=      len(lowercase_  ) - 1

					while left <= right:
										# avoid divided by 0 during interpolation
										if sorted_collection[left] == sorted_collection[right]:
															if sorted_collection[left] == item:
																				return left
															else:
																				return None

										snake_case_	=      left + ((item - sorted_collection[left]) * (right - left)) // (
										    sorted_collection[right] - sorted_collection[left]
										)

										# out of range check
										if point < 0 or point >= len(lowercase_  ):
															return None

										snake_case_	=      sorted_collection[point]
										if current_item == item:
															return point
										else:
															if point < left:
																				snake_case_	=      left
																				snake_case_	=      point
															elif point > right:
																				snake_case_	=      right
																				snake_case_	=      point
															else:
																				if item < current_item:
																									snake_case_	=      point - 1
																				else:
																									snake_case_	=      point + 1
					return None
def      __snake_case       (   lowercase   :							Optional[Any]			, lowercase   :							Dict			, lowercase   :							List[str]			, lowercase   :							int  ):




					if sorted_collection[left] == sorted_collection[right]:
										if sorted_collection[left] == item:
															return left
										else:
															return None

					snake_case_	=      left + ((item - sorted_collection[left]) * (right - left)) // (
					    sorted_collection[right] - sorted_collection[left]
					)

					# out of range check
					if point < 0 or point >= len(lowercase_  ):
										return None

					if sorted_collection[point] == item:
										return point
					elif point < left:
										return interpolation_search_by_recursion(lowercase_			, lowercase_			, lowercase_			, lowercase_  )
					elif point > right:
										return interpolation_search_by_recursion(lowercase_			, lowercase_			, lowercase_			, lowercase_  )
					else:
										if sorted_collection[point] > item:
															return interpolation_search_by_recursion(
															    lowercase_			, lowercase_			, lowercase_			, point - 1  )
										else:
															return interpolation_search_by_recursion(
															    lowercase_			, lowercase_			, point + 1			, lowercase_  )
def      __snake_case       (   lowercase   :							Any  ):




					if collection != sorted(lowercase_  ):
										raise ValueError("Collection must be ascending sorted"  )
					return True


if __name__ == "__main__":
					import sys
					lowercase__  							=					0
					if debug == 1:
										lowercase__  							=					[10, 30, 40, 45, 50, 66, 77, 93]
										try:
															__assert_sorted(collection)
										except ValueError:
															sys.exit('''Sequence must be ascending sorted to apply interpolation search''')
										lowercase__  							=					67

					lowercase__  							=					interpolation_search(collection, target)
					if result is not None:
										print(f"""{target} found at positions: {result}""")
					else:
										print('''Not found''')













'''simple docstring'''







from math import isqrt, loga


def       __UpperCamelCase					(      lowercase_       :  int   ):
       """simple docstring"""




       a_						     =			[True] * max_number
       for i in range(2   ,       isqrt(max_number - 1   ) + 1   ):
              if is_prime[i]:
                     for j in range(i**2   ,       lowercase_   ,       lowercase_   ):
                            a_						     =			False

       return [i for i in range(2   ,       lowercase_   ) if is_prime[i]]


def       __UpperCamelCase					(      lowercase_       :  int = 800_800   ,       lowercase_       :  int = 800_800   ):
       """simple docstring"""




       a_						     =			degree * loga(lowercase_   )
       a_						     =			int(lowercase_   )
       a_						     =			calculate_prime_numbers(lowercase_   )

       a_						     =			0
       a_						     =			0
       a_						     =			len(lowercase_   ) - 1
       while left < right:
              while (
                  prime_numbers[right] * loga(prime_numbers[left]   )
                  + prime_numbers[left] * loga(prime_numbers[right]   )
                  > upper_bound
              ):
                     right -= 1
              hybrid_integers_count += right - left
              left += 1

       return hybrid_integers_count


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




