def      a__ (		__UpperCamelCase     ,      __UpperCamelCase				):

      if not (isinstance(__UpperCamelCase     ,      __UpperCamelCase				) and isinstance(__UpperCamelCase     ,      __UpperCamelCase				)):
            raise ValueError("longest_common_substring() takes two strings for inputs"				)

      SCREAMING_SNAKE_CASE_          =  len(__UpperCamelCase				)
      SCREAMING_SNAKE_CASE_          =  len(__UpperCamelCase				)

      SCREAMING_SNAKE_CASE_          =  [[0] * (texta_length + 1) for _ in range(texta_length + 1				)]
      SCREAMING_SNAKE_CASE_          =  0
      SCREAMING_SNAKE_CASE_          =  0

      for i in range(1     ,      texta_length + 1				):
            for j in range(1     ,      texta_length + 1				):
                  if texta[i - 1] == texta[j - 1]:
                        SCREAMING_SNAKE_CASE_          =  1 + dp[i - 1][j - 1]
                        if dp[i][j] > ans_length:
                              SCREAMING_SNAKE_CASE_          =  i
                              SCREAMING_SNAKE_CASE_          =  dp[i][j]

      return texta[ans_index - ans_length : ans_index]


if __name__ == "__main__":
      import doctest

      doctest.testmod()



from collections.abc import Callable


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  a
      SCREAMING_SNAKE_CASE_          =  b
      if function(__UpperCamelCase				) == 0:  # one of the a or b is a root for the function
            return a
      elif function(__UpperCamelCase				) == 0:
            return b
      elif (
          function(__UpperCamelCase				) * function(__UpperCamelCase				) > 0
      ):  # if none of these are root and they are both positive or negative,
            # then this algorithm can't find the root
            raise ValueError("could not find root in given interval."				)
      else:
            SCREAMING_SNAKE_CASE_          =  start + (end - start) / 2.0
            while abs(start - mid				) > 1_0**-7:  # until precisely equals to 10^-7
                  if function(__UpperCamelCase				) == 0:
                        return mid
                  elif function(__UpperCamelCase				) * function(__UpperCamelCase				) < 0:
                        SCREAMING_SNAKE_CASE_          =  mid
                  else:
                        SCREAMING_SNAKE_CASE_          =  mid
                  SCREAMING_SNAKE_CASE_          =  start + (end - start) / 2.0
            return mid


def      a__ (		__UpperCamelCase				):
      return x**3 - 2 * x - 5


if __name__ == "__main__":
      print(bisection(f, 1, 10_00))

      import doctest

      doctest.testmod()


