





from __future__ import annotations

from statistics import mean







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







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


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






def  A					(				UpperCAmelCase	,	UpperCAmelCase					):
					# "Simpson Rule"
					# int(f) = delta_x/2 * (b-a)/3*(f1 + 4f2 + 2f_3 + ... + fn)
					_snake_case							:       List[str]												= (boundary[1] - boundary[0]) / steps
					_snake_case							:       List[Any]												= boundary[0]
					_snake_case							:       Tuple												= boundary[1]
					_snake_case							:       str												= make_points(UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase					)
					_snake_case							:       str												= 0.0
					y += (h / 3.0) * f(UpperCAmelCase					)
					_snake_case							:       Tuple												= 2
					for i in x_i:
										y += (h / 3) * (4 - 2 * (cnt % 2)) * f(UpperCAmelCase					)
										cnt += 1
					y += (h / 3.0) * f(UpperCAmelCase					)
					return y







def  A					(				UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase					):
					_snake_case							:       Union[str, Any]												= a + h
					while x < (b - h):
										yield x
										_snake_case							:       Optional[Any]												= x + h







def  A					(				UpperCAmelCase					):  # enter your function here
					_snake_case							:       Dict												= (x - 0) * (x - 0)
					return y







def  A					(				):
					_snake_case							:       int												= 0.0  # Lower bound of integration
					_snake_case							:       Union[str, Any]												= 1.0  # Upper bound of integration
					_snake_case							:       List[str]												= 1_0.0  # define number of steps or resolution
					_snake_case							:       Optional[int]												= [a, b]  # define boundary of integration
					_snake_case							:       List[str]												= method_a(UpperCAmelCase	,	UpperCAmelCase					)
					print(F"""y = {y}"""					)


if __name__ == "__main__":
							main()