





"""simple docstring"""




from __future__ import annotations

from statistics import mean





def 		UpperCAmelCase__						(	_UpperCAmelCase   ):






  """simple docstring"""





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





def 		UpperCAmelCase__						(	_UpperCAmelCase					,   _UpperCAmelCase   ):






  """simple docstring"""





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


if __name__ == "__main__":
   lowerCamelCase_	:		Optional[int]         =   [3, 5, 7]
   lowerCamelCase_	:		List[str]         =   calculate_waiting_times(burst_times)
   lowerCamelCase_	:		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        __lowerCAmelCase							(_UpperCamelCase = 10**6						):

	if n <= 0:
		raise ValueError('Please enter an integer greater than 0'						)

	__lowerCAmelCase     :		Optional[Any]		     = list(range(n + 1						)						)
	for number in range(2			,    n + 1						):
		if phi[number] == number:
			phi[number] -= 1
			for multiple in range(number * 2			,    n + 1			,    _UpperCamelCase						):
				__lowerCAmelCase     :		Tuple		     = (phi[multiple] // number) * (number - 1)

	__lowerCAmelCase     :		Any		     = 1
	for number in range(1			,    n + 1						):
		if (answer / phi[answer]) < (number / phi[number]):
			__lowerCAmelCase     :		List[Any]		     = number

	return answer


if __name__ == "__main__":
							print(solution())