


'''simple docstring'''




from __future__ import annotations

import pandas as pd





def 	a_					( lowerCamelCase	:     List[str]	, lowerCamelCase	:     Optional[int]	, lowerCamelCase	:     Optional[int]				):
   lowerCAmelCase     =			[0] * no_of_processes
   lowerCAmelCase     =			[0] * no_of_processes
   # Copy the burst time into remaining_time[]
   for i in range(_A				):
      lowerCAmelCase     =			burst_time[i]

   lowerCAmelCase     =			0
   lowerCAmelCase     =			0
   lowerCAmelCase     =			999999999
   lowerCAmelCase     =			0
   lowerCAmelCase     =			False

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

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

      lowerCAmelCase     =			remaining_time[short]
      if minm == 0:
         lowerCAmelCase     =			999999999

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

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

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

         if waiting_time[short] < 0:
            lowerCAmelCase     =			0

        # Increment time
      increment_time += 1
   return waiting_time





def 	a_					( lowerCamelCase	:     List[str]	, lowerCamelCase	:     int	, lowerCamelCase	:     List[Any]				):
   lowerCAmelCase     =			[0] * no_of_processes
   for i in range(_A				):
      lowerCAmelCase     =			burst_time[i] + waiting_time[i]
   return turn_around_time





def 	a_					( lowerCamelCase	:     Tuple	, lowerCamelCase	:     int	, lowerCamelCase	:     Any				):
   lowerCAmelCase     =			0
   lowerCAmelCase     =			0
   for i in range(_A				):
      lowerCAmelCase     =			total_waiting_time + waiting_time[i]
      lowerCAmelCase     =			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    						=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)











def 						lowerCamelCase__    (		):







	'''simple docstring'''





	snake_case_		    =     []
	snake_case_		    =     1

	while len(_A							) < 1E6:
		constant.append(str(_A							)							)
		i += 1

	snake_case_		    =     "".join(_A							)

	return (
	    int(constant[0]							)
	    * int(constant[9]							)
	    * int(constant[99]							)
	    * int(constant[999]							)
	    * int(constant[9999]							)
	    * int(constant[99999]							)
	    * int(constant[999999]							)
	)


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