



from __future__ import annotations

from statistics import mean



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



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


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


from math import pi




def  __a			(  UpperCAmelCase     )   ->float:



	"""simple docstring"""







	return degree / (180 / pi)


if __name__ == "__main__":
				from doctest import testmod

				testmod()

