


'''simple docstring'''


from __future__ import annotations

from statistics import mean







def     snake_case_     (						SCREAMING_SNAKE_CASE__  ):







				"""simple docstring"""





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







def     snake_case_     (						SCREAMING_SNAKE_CASE__							,   SCREAMING_SNAKE_CASE__  ):







				"""simple docstring"""





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


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







				"""simple docstring"""





				return (input_a, input_a).count(0  ) % 2







def     snake_case_     (						):







				"""simple docstring"""





				assert xor_gate(0							,   0  ) == 0
				assert xor_gate(0							,   1  ) == 1
				assert xor_gate(1							,   0  ) == 1
				assert xor_gate(1							,   1  ) == 0


if __name__ == "__main__":
				print(xor_gate(0, 0))
				print(xor_gate(0, 1))




