'''simple docstring'''

from __future__ import annotations

from statistics import mean



def  _lowerCAmelCase				(				__a      )  ->      list[int]:
     '''simple docstring'''







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



def  _lowerCAmelCase				(				__a			,      __a      )  ->      list[int]:
     '''simple docstring'''







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


if __name__ == "__main__":
      _lowerCamelCase :				List[Any]														= [3, 5, 7]
      _lowerCamelCase :				List[str]														= calculate_waiting_times(burst_times)
      _lowerCamelCase :				Union[str, 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'''

import numpy as np

_lowerCamelCase :				int														= [
    ["""a""", """b""", """c""", """d""", """e"""],
    ["""f""", """g""", """h""", """i""", """k"""],
    ["""l""", """m""", """n""", """o""", """p"""],
    ["""q""", """r""", """s""", """t""", """u"""],
    ["""v""", """w""", """x""", """y""", """z"""],
]




class    lowerCamelCase__  :



   def __init__(    self     )				->     None:
        """simple docstring"""





        _UpperCamelCase  :Any       =np.array(lowerCAmelCase__     )



   def  _UpperCamelCase		(    self					,      lowerCAmelCase__     )				->     np.ndarray:
        """simple docstring"""





        _UpperCamelCase       ,      _UpperCamelCase  :str       =np.where(letter == self.SQUARE     )
        _UpperCamelCase  :Union[str, Any]       =np.concatenate([indexa + 1, indexa + 1]     )
        return indexes



   def  _UpperCamelCase		(    self					,      lowerCAmelCase__					,      lowerCAmelCase__     )				->     str:
        """simple docstring"""





        return self.SQUARE[indexa - 1, indexa - 1]



   def  _UpperCamelCase		(    self					,      lowerCAmelCase__     )				->     str:
        """simple docstring"""





        _UpperCamelCase  :str       =message.lower()
        _UpperCamelCase  :List[Any]       =message.replace("""j"""					,      """i"""     )

        _UpperCamelCase  :List[str]       =""""""
        for letter_index in range(len(lowerCAmelCase__     )     ):
             if message[letter_index] != " ":
                  _UpperCamelCase  :Dict       =self.letter_to_numbers(message[letter_index]     )
                  _UpperCamelCase  :List[Any]       =encoded_message + str(numbers[0]     ) + str(numbers[1]     )
             elif message[letter_index] == " ":
                  _UpperCamelCase  :List[Any]       =encoded_message + """ """

        return encoded_message




   def  _UpperCamelCase		(    self					,      lowerCAmelCase__     )				->     str:
        """simple docstring"""





        _UpperCamelCase  :List[str]       =message.replace(""" """					,      """  """     )
        _UpperCamelCase  :Dict       =""""""
        for numbers_index in range(int(len(lowerCAmelCase__     ) / 2     )     ):
             if message[numbers_index * 2] != " ":
                  _UpperCamelCase  :Tuple       =message[numbers_index * 2]
                  _UpperCamelCase  :List[str]       =message[numbers_index * 2 + 1]

                  _UpperCamelCase  :Dict       =self.numbers_to_letter(int(lowerCAmelCase__     )					,      int(lowerCAmelCase__     )     )
                  _UpperCamelCase  :Union[str, Any]       =decoded_message + letter
             elif message[numbers_index * 2] == " ":
                  _UpperCamelCase  :Dict       =decoded_message + """ """

        return decoded_message