






'''simple docstring'''

from __future__ import annotations

import pandas as pd







def     lowercase__ (      __UpperCamelCase		,						__UpperCamelCase		,						__UpperCamelCase    )-> Optional[Any]:
      UpperCamelCase				  =					[0] * no_of_processes
      UpperCamelCase				  =					[0] * no_of_processes
      # Copy the burst time into remaining_time[]
      for i in range(UpperCamelCase_    ):
            UpperCamelCase				  =					burst_time[i]

      UpperCamelCase				  =					0
      UpperCamelCase				  =					0
      UpperCamelCase				  =					999999999
      UpperCamelCase				  =					0
      UpperCamelCase				  =					False

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

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

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

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

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

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

                  if waiting_time[short] < 0:
                        UpperCamelCase				  =					0

        # Increment time
            increment_time += 1
      return waiting_time







def     lowercase__ (      __UpperCamelCase		,						__UpperCamelCase		,						__UpperCamelCase    )-> List[Any]:
      UpperCamelCase				  =					[0] * no_of_processes
      for i in range(UpperCamelCase_    ):
            UpperCamelCase				  =					burst_time[i] + waiting_time[i]
      return turn_around_time







def     lowercase__ (      __UpperCamelCase		,						__UpperCamelCase		,						__UpperCamelCase    )-> List[Any]:
      UpperCamelCase				  =					0
      UpperCamelCase				  =					0
      for i in range(UpperCamelCase_    ):
            UpperCamelCase				  =					total_waiting_time + waiting_time[i]
            UpperCamelCase				  =					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')
     SCREAMING_SNAKE_CASE__      =   int(input())
     SCREAMING_SNAKE_CASE__      =   [0] * no_of_processes
     SCREAMING_SNAKE_CASE__      =   [0] * no_of_processes
     SCREAMING_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))
          SCREAMING_SNAKE_CASE__    ,      SCREAMING_SNAKE_CASE__      =   map(int, input().split())

     SCREAMING_SNAKE_CASE__      =   calculate_waitingtime(arrival_time, burst_time, no_of_processes)

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

     calculate_average_times(waiting_time, turn_around_time, no_of_processes)

     SCREAMING_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)


"""simple docstring"""





import requests
from bsa import BeautifulSoup



def 						_lowerCAmelCase				(				UpperCamelCase_ = "AAPL"				):
		__SCREAMING_SNAKE_CASE            = f"https://in.finance.yahoo.com/quote/{symbol}?s={symbol}"
		__SCREAMING_SNAKE_CASE            = BeautifulSoup(requests.get(UpperCamelCase_				).text  ,				"""html.parser"""				)
		__SCREAMING_SNAKE_CASE            = """My(6px) Pos(r) smartphone_Mt(6px)"""
		return soup.find("""div"""  ,				class_=class_				).find("""span"""				).text


if __name__ == "__main__":
							for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
														print(F"""Current {symbol:<4} stock price is {stock_price(symbol):>8}""")




