






"""simple docstring"""




from functools import lru_cache

@lru_cache
def     lowerCAmelCase__  (  UpperCamelCase__       ):



  '''simple docstring'''
  if not isinstance(UpperCamelCase__  ,     UpperCamelCase__       ):
    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__  (  UpperCamelCase__  ,     UpperCamelCase__       ):



  '''simple docstring'''
  _a						: int    =			len(UpperCamelCase__       )
  # Find m such that F_m >= n where F_i is the i_th fibonacci number.
  _a						: Union[str, Any]    =			0
  while True:
    if fibonacci(UpperCamelCase__       ) >= len_list:
      _a						: Union[str, Any]    =			i
      break
    i += 1
  _a						: List[Any]    =			0
  while fibb_k > 0:
    _a						: List[Any]    =			min(
        offset + fibonacci(fibb_k - 1       )  ,     len_list - 1       )  # Prevent out of range
    _a						: Tuple    =			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()









"""simple docstring"""




from __future__ import annotations

import sys

def     lowerCAmelCase__  (  UpperCamelCase__       ):



  '''simple docstring'''
  if n < 0:
    raise ValueError("""Negative arguments are not supported"""       )
  return _fib(UpperCamelCase__       )[0]

def     lowerCAmelCase__  (  UpperCamelCase__       ):



  '''simple docstring'''
  if n == 0:  # (F(0), F(1))
    return (0, 1)

  # F(2n) = F(n)[2F(n+1) − F(n)]
  # F(2n+1) = F(n+1)^2+F(n)^2
  _a   ,						_a						: Dict    =			_fib(n // 2       )
  _a						: Dict    =			a * (b * 2 - a)
  _a						: Optional[Any]    =			a * a + b * b
  return (d, c + d) if n % 2 else (c, d)


if __name__ == "__main__":
 _snake_case					   =     int(sys.argv[1])
 print(F'''fibonacci({n}) is {fibonacci(n)}''')

