





from __future__ import annotations

import pandas as pd






def lowerCamelCase__   (							snake_case_     :  list[int]	,				snake_case_     :  list[int]	,				snake_case_     :  int	)				->    list[int]:
   __snake_case								=       [0] * no_of_processes
   __snake_case								=       [0] * no_of_processes
   # Copy the burst time into remaining_time[]
   for i in range(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(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 lowerCamelCase__   (							snake_case_     :  list[int]	,				snake_case_     :  int	,				snake_case_     :  list[int]	)				->    list[int]:
   __snake_case								=       [0] * no_of_processes
   for i in range(snake_case_	):
      __snake_case								=       burst_time[i] + waiting_time[i]
   return turn_around_time






def lowerCamelCase__   (							snake_case_     :  list[int]	,				snake_case_     :  list[int]	,				snake_case_     :  int	)				->    None:
   __snake_case								=       0
   __snake_case								=       0
   for i in range(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')
    snake_case_           =      int(input())
    snake_case_           =      [0] * no_of_processes
    snake_case_           =      [0] * no_of_processes
    snake_case_           =      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))
        snake_case_      ,		snake_case_           =      map(int, input().split())

    snake_case_           =      calculate_waitingtime(arrival_time, burst_time, no_of_processes)

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

    calculate_average_times(waiting_time, turn_around_time, no_of_processes)

    snake_case_           =      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)








import math






def lowerCamelCase__   (							snake_case_     :  int	)				->    list[int]:
   __snake_case								=       []
   __snake_case								=       2
   __snake_case								=       int(math.sqrt(snake_case_	)	)  # Size of every segment
   __snake_case								=       [True] * (end + 1)
   __snake_case								=       []

   while start <= end:
      if temp[start] is True:
         in_prime.append(snake_case_	)
         for i in range(start * start	,				end + 1	,				snake_case_	):
            __snake_case								=       False
      start += 1
   prime += in_prime

   __snake_case								=       end + 1
   __snake_case								=       min(2 * end	,				snake_case_	)

   while low <= n:
      __snake_case								=       [True] * (high - low + 1)
      for each in in_prime:
         __snake_case								=       math.floor(low / each	) * each
         if t < low:
            t += each

         for j in range(snake_case_	,				high + 1	,				snake_case_	):
            __snake_case								=       False

      for j in range(len(snake_case_	)	):
         if temp[j] is True:
            prime.append(j + low	)

      __snake_case								=       high + 1
      __snake_case								=       min(high + end	,				snake_case_	)

   return prime







print(sieve(10**6))

