

"""simple docstring"""


from __future__ import annotations

from statistics import mean




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




def 				a (     UpperCamelCase_							:				str     ,	UpperCamelCase_							:				Any		)  ->		list[int]:
 return [burst + waiting for burst, waiting in zip(__a     ,	__a		)]


if __name__ == "__main__":
   _UpperCamelCase   :						Optional[Any]     						= [3, 5, 7]
   _UpperCamelCase   :						Optional[Any]     						= calculate_waiting_times(burst_times)
   _UpperCamelCase   :						Union[str, Any]     						= 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}''')













"""simple docstring"""


def 				a (     UpperCamelCase_							:				list     ,	UpperCamelCase_							:				int		)  ->		int:
 for index, item in enumerate(UpperCamelCase_		):
  if item == target:
   return index
 return -1




def 				a (     UpperCamelCase_							:				list     ,	UpperCamelCase_							:				int     ,	UpperCamelCase_							:				int     ,	UpperCamelCase_							:				int		)  ->		int:
 if not (0 <= high < len(UpperCamelCase_		) and 0 <= low < len(UpperCamelCase_		)):
  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(UpperCamelCase_     ,	low + 1     ,	high - 1     ,	UpperCamelCase_		)


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

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





