




'''simple docstring'''




snake_case__ 							=    [chr(i) for i in range(32, 1_26)]
snake_case__ 							=    list(range(len(alphabets)))
snake_case__ 							=    list(range(len(alphabets)))
snake_case__ 							=    list(range(len(alphabets)))
snake_case__ 							=    list(reversed(range(len(alphabets))))
snake_case__ 							=    []
snake_case__ 							=    snake_case__ 							=    snake_case__ 							=    0




def     snake_case__     (			) -> str:
					global gear_one_pos
					global gear_two_pos
					global gear_three_pos
					A_			:  Dict			=				gear_one[0]
					gear_one.append(lowerCamelCase__      )
					del gear_one[0]
					gear_one_pos += 1
					if gear_one_pos % int(len(lowerCamelCase__      )      ) == 0:
										A_			:  Dict			=				gear_two[0]
										gear_two.append(lowerCamelCase__      )
										del gear_two[0]
										gear_two_pos += 1
										if gear_two_pos % int(len(lowerCamelCase__      )      ) == 0:
															A_			:  Optional[int]			=				gear_three[0]
															gear_three.append(lowerCamelCase__      )
															del gear_three[0]
															gear_three_pos += 1




def     snake_case__     (			lowerCamelCase__					: Union[str, Any]      ) -> str:
					A_			:  str			=				alphabets.index(lowerCamelCase__      )
					A_			:  Union[str, Any]			=				gear_one[target]
					A_			:  List[Any]			=				gear_two[target]
					A_			:  Union[str, Any]			=				gear_three[target]
					A_			:  Union[str, Any]			=				reflector[target]
					A_			:  int			=				gear_three.index(lowerCamelCase__      )
					A_			:  Tuple			=				gear_two.index(lowerCamelCase__      )
					A_			:  str			=				gear_one.index(lowerCamelCase__      )
					code.append(alphabets[target]      )
					rotator()


if __name__ == "__main__":
							snake_case__ 							=    list(input("""Type your message:\n"""))
							while True:
														try:
																					snake_case__ 							=    int(input("""Please set token:(must be only digits)\n"""))
																					break
														except Exception as error:
																					print(error)
							for _ in range(token):
														rotator()
							for j in decode:
														engine(j)
							print("""\n""" + """""".join(code))
							print(
							    F'\nYour Token is {token} please write it down.\nIf you want to decode '
							    """this message again you should input same digits as token!"""
							)









'''simple docstring'''




from __future__ import annotations

from statistics import mean




def     snake_case__     (			lowerCamelCase__					: list[int]      ) -> list[int]:
					A_			:  Dict			=				2
					A_			:  List[str]			=				list(lowerCamelCase__      )
					A_			:  int			=				[0] * len(lowerCamelCase__      )
					A_			:  int			=				0
					while True:
										A_			:  List[str]			=				True
										for i, burst_time in enumerate(lowerCamelCase__      ):
															if rem_burst_times[i] > 0:
																				A_			:  Any			=				False
																				if rem_burst_times[i] > quantum:
																									t += quantum
																									rem_burst_times[i] -= quantum
																				else:
																									t += rem_burst_times[i]
																									A_			:  Any			=				t - burst_time
																									A_			:  Optional[int]			=				0
										if done is True:
															return waiting_times




def     snake_case__     (			lowerCamelCase__					: list[int]      ,		lowerCamelCase__					: list[int]      ) -> list[int]:
					return [burst + waiting for burst, waiting in zip(lowerCamelCase__      ,		lowerCamelCase__      )]


if __name__ == "__main__":
							snake_case__ 							=    [3, 5, 7]
							snake_case__ 							=    calculate_waiting_times(burst_times)
							snake_case__ 							=    calculate_turn_around_times(burst_times, waiting_times)
							print("""Process ID \tBurst Time \tWaiting Time \tTurnaround Time""")
							for i, burst_time in enumerate(burst_times):
														print(
														    F'  {i + 1}\t\t  {burst_time}\t\t  {waiting_times[i]}\t\t  '
														    F'{turn_around_times[i]}'
														)
							print(F'\nAverage waiting time = {mean(waiting_times):.5f}')
							print(F'Average turn around time = {mean(turn_around_times):.5f}')



