
'''simple docstring'''







import builtins
import sys

from ...utils.imports import _is_package_available
from . import cursor, input
from .helpers import Direction, clear_line, forceWrite, linebreak, move_cursor, reset_cursor, writeColor
from .keymap import KEYMAP


_lowercase :  Optional[int]    							=       False
try:
							_lowercase :  Optional[int]    							=       _is_package_available("google.colab")
except ModuleNotFoundError:
							pass






@input.register
class  lowerCAmelCase__   :






					def __init__(   self				,							__SCREAMING_SNAKE_CASE = None				,							__SCREAMING_SNAKE_CASE = []		):


											"""simple docstring"""





											lowercase_	:     Tuple													=       0
											lowercase_	:     Dict													=       choices
											lowercase_	:     Tuple													=       prompt
											if sys.platform == "win32":
																	lowercase_	:     Union[str, Any]													=       '''*'''
											else:
																	lowercase_	:     Optional[int]													=       '''➔ '''






					def 	_snake_case    (   self				,							__SCREAMING_SNAKE_CASE				,							__SCREAMING_SNAKE_CASE = ""		):


											"""simple docstring"""





											if sys.platform != "win32":
																	writeColor(self.choices[index]				,							32				,							__SCREAMING_SNAKE_CASE		)
											else:
																	forceWrite(self.choices[index]				,							__SCREAMING_SNAKE_CASE		)






					def 	_snake_case    (   self				,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											if index == self.position:
																	forceWrite(F''' {self.arrow_char} '''		)
																	self.write_choice(__SCREAMING_SNAKE_CASE		)
											else:
																	forceWrite(F'''    {self.choices[index]}'''		)
											reset_cursor()






					def 	_snake_case    (   self				,							__SCREAMING_SNAKE_CASE				,							__SCREAMING_SNAKE_CASE = 1		):


											"""simple docstring"""





											lowercase_	:     List[str]													=       self.position
											if direction == Direction.DOWN:
																	if self.position + 1 >= len(self.choices		):
																							return
																	self.position += num_spaces
											else:
																	if self.position - 1 < 0:
																							return
																	self.position -= num_spaces
											clear_line()
											self.print_choice(__SCREAMING_SNAKE_CASE		)
											move_cursor(__SCREAMING_SNAKE_CASE				,							direction.name		)
											self.print_choice(self.position		)






					@input.mark(KEYMAP['''up''']		)
					def 	_snake_case    (   self		):


											"""simple docstring"""





											self.move_direction(Direction.UP		)






					@input.mark(KEYMAP['''down''']		)
					def 	_snake_case    (   self		):


											"""simple docstring"""





											self.move_direction(Direction.DOWN		)






					@input.mark(KEYMAP['''newline''']		)
					def 	_snake_case    (   self		):


											"""simple docstring"""





											move_cursor(len(self.choices		) - self.position				,							'''DOWN'''		)
											return self.position






					@input.mark(KEYMAP['''interrupt''']		)
					def 	_snake_case    (   self		):


											"""simple docstring"""





											move_cursor(len(self.choices		) - self.position				,							'''DOWN'''		)
											raise KeyboardInterrupt






					@input.mark_multiple(*[KEYMAP[str(__SCREAMING_SNAKE_CASE		)] for number in range(10		)]		)
					def 	_snake_case    (   self		):


											"""simple docstring"""





											lowercase_	:     Tuple													=       int(chr(self.current_selection		)		)
											lowercase_	:     int													=       index - self.position
											if index == self.position:
																	return
											if index < len(self.choices		):
																	if self.position > index:
																							self.move_direction(Direction.UP				,							-movement		)
																	elif self.position < index:
																							self.move_direction(Direction.DOWN				,							__SCREAMING_SNAKE_CASE		)
																	else:
																							return
											else:
																	return






					def 	_snake_case    (   self				,							__SCREAMING_SNAKE_CASE = 0		):


											"""simple docstring"""





											if self.prompt:
																	linebreak()
																	forceWrite(self.prompt				,							'''\n'''		)
																	if in_colab:
																							forceWrite('''Please input a choice index (starting from 0), and press enter'''				,							'''\n'''		)
																	else:
																							forceWrite('''Please select a choice using the arrow or number keys, and selecting with enter'''				,							'''\n'''		)
											lowercase_	:     List[str]													=       default_choice
											for i in range(len(self.choices		)		):
																	self.print_choice(__SCREAMING_SNAKE_CASE		)
																	forceWrite('''\n'''		)
											move_cursor(len(self.choices		) - self.position				,							'''UP'''		)
											with cursor.hide():
																	while True:
																							if in_colab:
																													try:
																																			lowercase_	:     Union[str, Any]													=       int(builtins.input()		)
																													except ValueError:
																																			lowercase_	:     List[Any]													=       default_choice
																							else:
																													lowercase_	:     Union[str, Any]													=       self.handle_input()
																							if choice is not None:
																													reset_cursor()
																													for _ in range(len(self.choices		) + 1		):
																																			move_cursor(1				,							'''UP'''		)
																																			clear_line()
																													self.write_choice(__SCREAMING_SNAKE_CASE				,							'''\n'''		)
																													return choice





'''simple docstring'''







from math import isqrt, loga
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int							):



						"""simple docstring"""





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

						return [i for i in range(2      ,      __SCREAMING_SNAKE_CASE							) if is_prime[i]]
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int = 800800      ,      __SCREAMING_SNAKE_CASE					: int = 800800							):



						"""simple docstring"""





						lowercase_	:     Union[str, Any]													=       degree * loga(__SCREAMING_SNAKE_CASE							)
						lowercase_	:     Any													=       int(__SCREAMING_SNAKE_CASE							)
						lowercase_	:     Optional[Any]													=       calculate_prime_numbers(__SCREAMING_SNAKE_CASE							)

						lowercase_	:     Optional[Any]													=       0
						lowercase_	:     List[Any]													=       0
						lowercase_	:     Union[str, Any]													=       len(__SCREAMING_SNAKE_CASE							) - 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() = }""")



