





"""simple docstring"""



from __future__ import annotations

from statistics import mean







def 	__lowercase  (     snake_case_						:						list[int]		)     ->list[int]:



    '''simple docstring'''







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







def 	__lowercase  (     snake_case_						:						list[int]       ,snake_case_						:						list[int]		)     ->list[int]:



    '''simple docstring'''







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


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



from __future__ import annotations

import sys







def 	__lowercase  (     snake_case_						:						int       ,snake_case_						:						int		)     ->tuple[int, int]:



    '''simple docstring'''







    if abs(snake_case_		) == 1:
        return a, 0
    elif abs(snake_case_		) == 1:
        return 0, b

    __A				, __A					:		int						=  a, b
    __A				, __A					:		Any						=  1, 0
    __A				, __A					:		int						=  0, 1

    while remainder != 0:
        __A					:		List[Any]						=  old_remainder // remainder
        __A				, __A					:		int						=  remainder, old_remainder - quotient * remainder
        __A				, __A					:		List[Any]						=  coeff_a, old_coeff_a - quotient * coeff_a
        __A				, __A					:		Union[str, Any]						=  coeff_b, old_coeff_b - quotient * coeff_b

    # sign correction for negative numbers
    if a < 0:
        __A					:		Optional[Any]						=  -old_coeff_a
    if b < 0:
        __A					:		List[Any]						=  -old_coeff_b

    return old_coeff_a, old_coeff_b







def 	__lowercase  (     )     ->List[str]:



    '''simple docstring'''







    if len(sys.argv		) < 3:
        print('''2 integer arguments required'''		)
        return 1
    __A					:		Optional[int]						=  int(sys.argv[1]		)
    __A					:		Tuple						=  int(sys.argv[2]		)
    print(extended_euclidean_algorithm(snake_case_       ,snake_case_		)		)
    return 0


if __name__ == "__main__":
       raise SystemExit(main())




