
"""simple docstring"""
from __future__ import annotations

from statistics import mean
def 					a__ ( a :					list[int]		):

  """simple docstring"""







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

  """simple docstring"""







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


if __name__ == "__main__":
    _a   :      Dict       =				[3, 5, 7]
    _a   :      Dict       =				calculate_waiting_times(burst_times)
    _a   :      Tuple       =				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 						__magic_name__(			_A       ):
						'''simple docstring'''





						UpperCamelCase__       =			len(_A       )

						# Set the gap value to be decreased by a factor of 1.3
						# after each iteration
						UpperCamelCase__       =			1.3

						# Continue sorting until the gap is 1
						while gap > 1:
												# Decrease the gap value
												UpperCamelCase__       =			int(gap / shrink       )

												# Sort the elements using insertion sort
												for i in range(_A    ,   len(_A       )       ):
																		UpperCamelCase__       =			collection[i]
																		UpperCamelCase__       =			i
																		while j >= gap and collection[j - gap] > temp:
																								UpperCamelCase__       =			collection[j - gap]
																								j -= gap
																		UpperCamelCase__       =			temp

						return collection


if __name__ == "__main__":
					import doctest

					doctest.testmod()
