






from __future__ import annotations

from statistics import mean
def      lowerCamelCase					(						a_	)	->			list[int]:
							lowerCAmelCase_										=     2
							lowerCAmelCase_										=     list(a_	)
							lowerCAmelCase_										=     [0] * len(a_	)
							lowerCAmelCase_										=     0
							while True:
														lowerCAmelCase_										=     True
														for i, burst_time in enumerate(a_	):
																					if rem_burst_times[i] > 0:
																												lowerCAmelCase_										=     False
																												if rem_burst_times[i] > quantum:
																																			t += quantum
																																			rem_burst_times[i] -= quantum
																												else:
																																			t += rem_burst_times[i]
																																			lowerCAmelCase_										=     t - burst_time
																																			lowerCAmelCase_										=     0
														if done is True:
																					return waiting_times
def      lowerCamelCase					(						a_ ,						a_	)	->			list[int]:
							return [burst + waiting for burst, waiting in zip(a_ ,						a_	)]


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











from doctest import testmod
from math import sqrt
def      lowerCamelCase					(						a_	)	->			list:
							lowerCAmelCase_										=     []
							if num < 1:
														return facs
							facs.append(1	)
							if num == 1:
														return facs
							facs.append(a_	)
							for i in range(2 ,						int(sqrt(a_	)	) + 1	):
														if num % i == 0:  # If i is a factor of num
																					facs.append(a_	)
																					lowerCAmelCase_										=     num // i  # num//i is the other factor of num
																					if d != i:  # If d and i are distinct
																												facs.append(a_	)  # we have found another factor
							facs.sort()
							return facs


if __name__ == "__main__":
		testmod(name="""factors_of_a_number""", verbose=True)



