
'''simple docstring'''
from __future__ import annotations

import pandas as pd






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							_snake_case  =    [0] * no_of_processes
							_snake_case  =    [0] * no_of_processes
							# Copy the burst time into remaining_time[]
							for i in range(_SCREAMING_SNAKE_CASE ):
														_snake_case  =    burst_time[i]

							_snake_case  =    0
							_snake_case  =    0
							_snake_case  =    9_9999_9999
							_snake_case  =    0
							_snake_case  =    False

							# Process until all processes are completed
							while complete != no_of_processes:
														for j in range(_SCREAMING_SNAKE_CASE ):
																					if arrival_time[j] <= increment_time and remaining_time[j] > 0:
																												if remaining_time[j] < minm:
																																			_snake_case  =    remaining_time[j]
																																			_snake_case  =    j
																																			_snake_case  =    True

														if not check:
																					increment_time += 1
																					continue
														remaining_time[short] -= 1

														_snake_case  =    remaining_time[short]
														if minm == 0:
																					_snake_case  =    9_9999_9999

														if remaining_time[short] == 0:
																					complete += 1
																					_snake_case  =    False

																					# Find finish time of current process
																					_snake_case  =    increment_time + 1

																					# Calculate waiting time
																					_snake_case  =    finish_time - arrival_time[short]
																					_snake_case  =    finar - burst_time[short]

																					if waiting_time[short] < 0:
																												_snake_case  =    0

																												# Increment time
														increment_time += 1
							return waiting_time






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							_snake_case  =    [0] * no_of_processes
							for i in range(_SCREAMING_SNAKE_CASE ):
														_snake_case  =    burst_time[i] + waiting_time[i]
							return turn_around_time






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							_snake_case  =    0
							_snake_case  =    0
							for i in range(_SCREAMING_SNAKE_CASE ):
														_snake_case  =    total_waiting_time + waiting_time[i]
														_snake_case  =    total_turn_around_time + turn_around_time[i]
							print(f"""Average waiting time = {total_waiting_time / no_of_processes:.5f}""" )
							print("""Average turn around time ="""				,   total_turn_around_time / no_of_processes )


if __name__ == "__main__":
				print('Enter how many process you want to analyze')
				__lowerCAmelCase					=			int(input())
				__lowerCAmelCase					=			[0] * no_of_processes
				__lowerCAmelCase					=			[0] * no_of_processes
				__lowerCAmelCase					=			list(range(1, no_of_processes + 1))

				for i in range(no_of_processes):
								print('Enter the arrival time and burst time for process:--' + str(i + 1))
								__lowerCAmelCase				,							__lowerCAmelCase					=			map(int, input().split())

				__lowerCAmelCase					=			calculate_waitingtime(arrival_time, burst_time, no_of_processes)

				__lowerCAmelCase					=			burst_time
				__lowerCAmelCase					=			no_of_processes
				__lowerCAmelCase					=			waiting_time
				__lowerCAmelCase					=			calculate_turnaroundtime(bt, n, wt)

				calculate_average_times(waiting_time, turn_around_time, no_of_processes)

				__lowerCAmelCase					=			pd.DataFrame(
				    list(zip(processes, burst_time, arrival_time, waiting_time, turn_around_time)),
				    columns=[
				        'Process',
				        'BurstTime',
				        'ArrivalTime',
				        'WaitingTime',
				        'TurnAroundTime',
				    ],
				)

				# Printing the dataFrame
				pd.set_option('display.max_rows', fcfs.shape[0] + 1)
				print(fcfs)






"""simple docstring"""





from __future__ import annotations

import math
def 					__A  (_SCREAMING_SNAKE_CASE     )   ->bool:





  """simple docstring"""


  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5	,  int(math.sqrt(_SCREAMING_SNAKE_CASE     ) + 1     )	,  6     ):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True


__A											=						[num for num in range(3, 10_0001, 2) if not is_prime(num)]
def 					__A  (_SCREAMING_SNAKE_CASE     )   ->list[int]:





  """simple docstring"""


  if not isinstance(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     ):
    raise ValueError('n must be an integer'     )
  if n <= 0:
    raise ValueError('n must be >= 0'     )

  lowerCAmelCase__     :Tuple											=				[]
  for num in range(len(_SCREAMING_SNAKE_CASE     )     ):
    lowerCAmelCase__     :int											=				0
    while 2 * i * i <= odd_composites[num]:
      lowerCAmelCase__     :int											=				odd_composites[num] - 2 * i * i
      if is_prime(_SCREAMING_SNAKE_CASE     ):
        break
      i += 1
    else:
      list_nums.append(odd_composites[num]     )
      if len(_SCREAMING_SNAKE_CASE     ) == n:
        return list_nums

  return []
def 					__A  ()   ->int:





  """simple docstring"""


  return compute_nums(1     )[0]


if __name__ == "__main__":
  print(F'''{solution() = }''')
