




from functools import lru_cache



@lru_cache
def     lowerCAmelCase		(		_lowerCAmelCase				: int						):




 """simple docstring"""







 if not isinstance(_lowerCAmelCase    ,				_lowerCAmelCase						):
  raise TypeError("k must be an integer."						)
 if k < 0:
  raise ValueError("k integer must be greater or equal to zero."						)
 if k == 0:
  return 0
 elif k == 1:
  return 1
 else:
  return fibonacci(k - 1						) + fibonacci(k - 2						)



def     lowerCAmelCase		(		_lowerCAmelCase				: list    ,				_lowerCAmelCase				: int						):




 """simple docstring"""







 UpperCAmelCase__							=    len(_lowerCAmelCase						)
 # Find m such that F_m >= n where F_i is the i_th fibonacci number.
 UpperCAmelCase__							=    0
 while True:
  if fibonacci(_lowerCAmelCase						) >= len_list:
   UpperCAmelCase__							=    i
   break
  i += 1
 UpperCAmelCase__							=    0
 while fibb_k > 0:
  UpperCAmelCase__							=    min(
      offset + fibonacci(fibb_k - 1						)    ,				len_list - 1						)  # Prevent out of range
  UpperCAmelCase__							=    arr[index_k]
  if item_k_1 == val:
   return index_k
  elif val < item_k_1:
   fibb_k -= 1
  elif val > item_k_1:
   offset += fibonacci(fibb_k - 1						)
   fibb_k -= 2
 else:
  return -1


if __name__ == "__main__":
  import doctest

  doctest.testmod()






from __future__ import annotations

from statistics import mean

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

def   a_					(_lowerCAmelCase  :   list[int]			,	_lowerCAmelCase  :   list[int]       )->				list[int]:
    return [burst + waiting for burst, waiting in zip(_lowerCAmelCase			,	_lowerCAmelCase       )]


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


