





'''simple docstring'''







from __future__ import annotations

def 		SCREAMING_SNAKE_CASE      (					lowerCAmelCase__     :	list[int]       ,  lowerCAmelCase__     :	int):

     '''simple docstring'''




     _lowercase							:      Any  						=							0, len(lowerCAmelCase__) - 1
     while start_ind <= end_ind:
          if array[start_ind] == search_item:
               return start_ind
          elif array[end_ind] == search_item:
               return end_ind
          else:
               start_ind += 1
               end_ind -= 1
    # returns -1 if search_item is not found in array
     return -1


if __name__ == "__main__":
    print(double_linear_search(list(range(1_00)), 40))






'''simple docstring'''







from __future__ import annotations

import math
import random

def 		SCREAMING_SNAKE_CASE      (					lowerCAmelCase__     :	int       ,  lowerCAmelCase__     :	int       ,  lowerCAmelCase__     :	int)			->						list[int]:

     '''simple docstring'''




     _lowercase							:      Optional[Any]  						=							d * e - 1
     _lowercase							:      Optional[Any]  						=							0
     _lowercase							:      Dict  						=							0
     while p == 0:
          _lowercase							:      Optional[Any]  						=							random.randint(2       ,  n - 1)
          _lowercase							:      int  						=							k
          while True:
               if t % 2 == 0:
                    _lowercase							:      int  						=							t // 2
                    _lowercase							:      Any  						=							(g**t) % n
                    _lowercase							:      Tuple  						=							math.gcd(x - 1       ,  lowerCAmelCase__)
                    if x > 1 and y > 1:
                         _lowercase							:      Union[str, Any]  						=							y
                         _lowercase							:      Dict  						=							n // y
                         break  # find the correct factors
               else:
                    break  # t is not divisible by 2, break and choose another g
     return sorted([p, q])


if __name__ == "__main__":
    import doctest

    doctest.testmod()