

from __future__ import annotations

from statistics import mean





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





def  _snake_case		(snake_case_					:     List[Any]    ,       snake_case_					:     int  )							->		list[int]:
  return [burst + waiting for burst, waiting in zip(_UpperCAmelCase    ,       _UpperCAmelCase  )]


if __name__ == "__main__":
      _SCREAMING_SNAKE_CASE							 =			[3, 5, 7]
      _SCREAMING_SNAKE_CASE							 =			calculate_waiting_times(burst_times)
      _SCREAMING_SNAKE_CASE							 =			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__      (	_UpperCAmelCase						,  _UpperCAmelCase						,  _UpperCAmelCase						)     ->	float:

 '''simple docstring'''






 snake_case__     				=					[1 / first_term]
 snake_case__     				=					1 / first_term
 for _ in range(number_of_terms - 1						):
  first_term += common_difference
  arithmetic_progression.append(_UpperCAmelCase						)
 snake_case__     				=					[1 / step for step in arithmetic_progression]
 return sum(_UpperCAmelCase						)


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   print(sum_of_harmonic_progression(1 / 2, 2, 2))

