
"""simple docstring"""




from __future__ import annotations

from statistics import mean



def 				a__			(					lowerCAmelCase						:							list[int]		):






     '''simple docstring'''
     UpperCAmelCase__				:			Union[str, Any]							=    2
     UpperCAmelCase__				:			List[Any]							=    list(lowerCAmelCase		)
     UpperCAmelCase__				:			int							=    [0] * len(lowerCAmelCase		)
     UpperCAmelCase__				:			int							=    0
     while True:
          UpperCAmelCase__				:			int							=    True
          for i, burst_time in enumerate(lowerCAmelCase		):
               if rem_burst_times[i] > 0:
                    UpperCAmelCase__				:			List[Any]							=    False
                    if rem_burst_times[i] > quantum:
                         t += quantum
                         rem_burst_times[i] -= quantum
                    else:
                         t += rem_burst_times[i]
                         UpperCAmelCase__				:			List[str]							=    t - burst_time
                         UpperCAmelCase__				:			Union[str, Any]							=    0
          if done is True:
               return waiting_times



def 				a__			(					lowerCAmelCase						:							list[int]							,     lowerCAmelCase						:							list[int]		):






     '''simple docstring'''
     return [burst + waiting for burst, waiting in zip(lowerCAmelCase							,     lowerCAmelCase		)]


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





"""simple docstring"""




def 				a__			(					lowerCAmelCase						:							int		):






     '''simple docstring'''
     if number != int(lowerCAmelCase		):
          raise ValueError("factorial() only accepts integral values"		)
     if number < 0:
          raise ValueError("factorial() not defined for negative values"		)
     UpperCAmelCase__				:			int							=    1
     for i in range(1							,     number + 1		):
          value *= i
     return value



def 				a__			(					lowerCAmelCase						:							int		):






     '''simple docstring'''
     if not isinstance(lowerCAmelCase							,     lowerCAmelCase		):
          raise ValueError("factorial() only accepts integral values"		)
     if n < 0:
          raise ValueError("factorial() not defined for negative values"		)
     return 1 if n == 0 or n == 1 else n * factorial(n - 1		)


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    A__   :						Any 							=     int(input("""Enter a positive integer: """).strip() or 0)
    print(f"""factorial{n} is {factorial(n)}""")



