"""simple docstring"""






from collections.abc import Callable



def   a_						(					lowerCamelCase					,			lowerCamelCase					,			lowerCamelCase       ):
				UpperCAmelCase__             =							a
				UpperCAmelCase__             =							b
				if function(__lowerCamelCase       ) == 0:  # one of the a or b is a root for the function
								return a
				elif function(__lowerCamelCase       ) == 0:
								return b
				elif (
				    function(__lowerCamelCase       ) * function(__lowerCamelCase       ) > 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:
								UpperCAmelCase__             =							start + (end - start) / 2.0
								while abs(start - mid       ) > 1_0**-7:  # until precisely equals to 10^-7
												if function(__lowerCamelCase       ) == 0:
																return mid
												elif function(__lowerCamelCase       ) * function(__lowerCamelCase       ) < 0:
																UpperCAmelCase__             =							mid
												else:
																UpperCAmelCase__             =							mid
												UpperCAmelCase__             =							start + (end - start) / 2.0
								return mid



def   a_						(					lowerCamelCase       ):
				return x**3 - 2 * x - 5


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

						import doctest

						doctest.testmod()





def 			UpperCamelCase					(    __lowerCamelCase     : str				,					__lowerCamelCase     : int    ):
       snake_case       :   list[list[str]]							=      [[] for _ in range(__lowerCamelCase    )]
       snake_case       :   int							=      key - 1

       if key <= 0:
              raise ValueError("Height of grid can't be 0 or negative"    )
       if key == 1 or len(__lowerCamelCase    ) <= key:
              return input_string

       for position, character in enumerate(__lowerCamelCase    ):
              snake_case       :   Any							=      position % (lowest * 2)  # puts it in bounds
              snake_case       :   Optional[int]							=      min(__lowerCamelCase				,					lowest * 2 - num    )  # creates zigzag pattern
              temp_grid[num].append(__lowerCamelCase    )
       snake_case       :   List[str]							=      ["".join(__lowerCamelCase    ) for row in temp_grid]
       snake_case       :   Tuple							=      "".join(__lowerCamelCase    )

       return output_string


def 			UpperCamelCase					(    __lowerCamelCase     : str				,					__lowerCamelCase     : int    ):
       snake_case       :   Dict							=      []
       snake_case       :   Union[str, Any]							=      key - 1

       if key <= 0:
              raise ValueError("Height of grid can't be 0 or negative"    )
       if key == 1:
              return input_string

       snake_case       :   list[list[str]]							=      [[] for _ in range(__lowerCamelCase    )]  # generates template
       for position in range(len(__lowerCamelCase    )    ):
              snake_case       :   List[str]							=      position % (lowest * 2)  # puts it in bounds
              snake_case       :   Optional[int]							=      min(__lowerCamelCase				,					lowest * 2 - num    )  # creates zigzag pattern
              temp_grid[num].append("*"    )

       snake_case       :   Tuple							=      0
       for row in temp_grid:  # fills in the characters
              snake_case       :   Union[str, Any]							=      input_string[counter : counter + len(__lowerCamelCase    )]
              grid.append(list(__lowerCamelCase    )    )
              counter += len(__lowerCamelCase    )

       snake_case       :   str							=      ""  # reads as zigzag
       for position in range(len(__lowerCamelCase    )    ):
              snake_case       :   Optional[int]							=      position % (lowest * 2)  # puts it in bounds
              snake_case       :   Tuple							=      min(__lowerCamelCase				,					lowest * 2 - num    )  # creates zigzag pattern
              output_string += grid[num][0]
              grid[num].pop(0    )
       return output_string


def 			UpperCamelCase					(    __lowerCamelCase     : str    ):
       snake_case       :   Tuple							=      {}
       for key_guess in range(1				,					len(__lowerCamelCase    )    ):  # tries every key
              snake_case       :   Any							=      decrypt(__lowerCamelCase				,					__lowerCamelCase    )
       return results


if __name__ == "__main__":
   import doctest

   doctest.testmod()





