


'''simple docstring'''



import math
from decimal import Decimal, getcontext




def       _a      (		_lowercase   :      int = 4000000    ):





     '''simple docstring'''






     try:
          __UpperCAmelCase      :					List[str]    				=     int(_lowercase    )
     except (TypeError, ValueError):
          raise TypeError('''Parameter n must be int or castable to int.'''    )
     if n <= 0:
          raise ValueError('''Parameter n must be greater than or equal to one.'''    )
     __UpperCAmelCase      :					Tuple    				=     100
     __UpperCAmelCase      :					Optional[Any]    				=     (Decimal(5    ) ** Decimal(0.5    ) + 1) / Decimal(2    )

     __UpperCAmelCase      :					Tuple    				=     (math.floor(math.log(n * (phi + 2)     ,   _lowercase    ) - 1    ) // 3) * 3 + 2
     __UpperCAmelCase      :					List[Any]    				=     Decimal(round(phi ** Decimal(index + 1    )    )    ) / (phi + 2)
     __UpperCAmelCase      :					List[str]    				=     num // 2
     return int(_lowercase    )


if __name__ == "__main__":
      print(f"""{solution() = }""")



'''simple docstring'''



import os
import unittest

import pytest
from parameterized import parameterized

from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device


# skipping in unittest tests

__UpperCAmelCase     :Tuple												=  [(1,)]




def       _a      (		):





     '''simple docstring'''






     __UpperCAmelCase      :					Any    				=     bool(os.getenv('''RUN_SLOW'''     ,   0    )    )
     if run_slow:
          assert True
     else:
          assert False, "should have been skipped"




def       _a      (		):





     '''simple docstring'''






     __UpperCAmelCase      :					str    				=     bool(os.getenv('''RUN_SLOW'''     ,   0    )    )
     if run_slow and torch_device == "cuda":
          assert True
     else:
          assert False, "should have been skipped"



@require_torch
class       a							(						unittest.TestCase			):


     """simple docstring"""






     @slow
     @require_torch_gpu
     def 					lowerCamelCase__					(							self	:						Tuple     )		->				str:
          check_slow_torch_cuda()

     @require_torch_gpu
     @slow
     def 					lowerCamelCase__					(							self	:						Any     )		->				List[Any]:
          check_slow_torch_cuda()






     @parameterized.expand(snake_case     )
     @slow
     def 					lowerCamelCase__					(							self	:						Union[str, Any]				,					snake_case	:						int=None     )		->				Union[str, Any]:
          check_slow()




@slow
@require_torch_gpu
def       _a      (		):





     '''simple docstring'''






     check_slow_torch_cuda()




@require_torch_gpu
@slow
def       _a      (		):





     '''simple docstring'''






     check_slow_torch_cuda()




@slow
@pytest.mark.parametrize('''param'''     ,   [1]    )
def       _a      (		_lowercase   :      Union[str, Any]    ):





     '''simple docstring'''






     check_slow()




@pytest.mark.parametrize('''param'''     ,   [1]    )
@slow
def       _a      (		_lowercase   :      Dict    ):





     '''simple docstring'''






     check_slow()