





"""simple docstring"""




from __future__ import annotations

from statistics import mean





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





def 			a_							(				_lowercase			,		_lowercase  ):
						return [burst + waiting for burst, waiting in zip(_lowercase			,		_lowercase  )]


if __name__ == "__main__":
						UpperCamelCase_	 =[3, 5, 7]
						UpperCamelCase_	 =calculate_waiting_times(burst_times)
						UpperCamelCase_	 =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 							UpperCamelCase_       (       lowerCAmelCase__ :							int = 400_0000		)		->  int:

  """simple docstring"""




  if n <= 1:
    return 0
  lowerCAmelCase_  :							Union[str, Any]								=					0
  lowerCAmelCase_  :							Tuple								=					2
  lowerCAmelCase_  :							List[Any]								=					0
  while 4 * b + a <= n:
    lowerCAmelCase_		,lowerCAmelCase_  :							str								=					b, 4 * b + a
    count += a
  return count + b


if __name__ == "__main__":
     print(f'{solution() = }')





