


def SCREAMING_SNAKE_CASE_  (				__lowerCamelCase:		list  ,			__lowerCamelCase:		int  ):







	'''simple docstring'''



	for index, item in enumerate(__lowerCamelCase  ):
		if item == target:
			return index
	return -1




def SCREAMING_SNAKE_CASE_  (				__lowerCamelCase:		list  ,			__lowerCamelCase:		int  ,			__lowerCamelCase:		int  ,			__lowerCamelCase:		int  ):







	'''simple docstring'''



	if not (0 <= high < len(__lowerCamelCase  ) and 0 <= low < len(__lowerCamelCase  )):
		raise Exception("Invalid upper or lower bound!"  )
	if high < low:
		return -1
	if sequence[low] == target:
		return low
	if sequence[high] == target:
		return high
	return rec_linear_search(__lowerCamelCase  ,			low + 1  ,			high - 1  ,			__lowerCamelCase  )


if __name__ == "__main__":
							SCREAMING_SNAKE_CASE__       			=				input("""Enter numbers separated by comma:\n""").strip()
							SCREAMING_SNAKE_CASE__       			=				[int(item.strip()) for item in user_input.split(""",""")]

							SCREAMING_SNAKE_CASE__       			=				int(input("""Enter a single number to be found in the list:\n""").strip())
							SCREAMING_SNAKE_CASE__       			=				linear_search(sequence, target)
							if result != -1:
														print(f"""linear_search({sequence}, {target}) = {result}""")
							else:
														print(f"""{target} was not found in {sequence}""")





from __future__ import annotations

from statistics import mean




def SCREAMING_SNAKE_CASE_  (				__lowerCamelCase:		list[int]  ):







	'''simple docstring'''



	lowercase_			 = 2
	lowercase_			 = list(__lowerCamelCase  )
	lowercase_			 = [0] * len(__lowerCamelCase  )
	lowercase_			 = 0
	while True:
		lowercase_			 = True
		for i, burst_time in enumerate(__lowerCamelCase  ):
			if rem_burst_times[i] > 0:
				lowercase_			 = False
				if rem_burst_times[i] > quantum:
					t += quantum
					rem_burst_times[i] -= quantum
				else:
					t += rem_burst_times[i]
					lowercase_			 = t - burst_time
					lowercase_			 = 0
		if done is True:
			return waiting_times




def SCREAMING_SNAKE_CASE_  (				__lowerCamelCase:		list[int]  ,			__lowerCamelCase:		list[int]  ):







	'''simple docstring'''



	return [burst + waiting for burst, waiting in zip(__lowerCamelCase  ,			__lowerCamelCase  )]


if __name__ == "__main__":
							SCREAMING_SNAKE_CASE__       			=				[3, 5, 7]
							SCREAMING_SNAKE_CASE__       			=				calculate_waiting_times(burst_times)
							SCREAMING_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}""")

