
import random





class       _lowerCAmelCase   :




				@staticmethod
				def 	__a		(   _UpperCamelCase	)							-> tuple[list[int], list[int]]:
							lowerCAmelCase_         =      [ord(_UpperCamelCase	) for i in text]
							lowerCAmelCase_         =      []
							lowerCAmelCase_         =      []
							for i in plain:
										lowerCAmelCase_         =      random.randint(1							,							300	)
										lowerCAmelCase_         =      (i + k) * k
										cipher.append(_UpperCamelCase	)
										key.append(_UpperCamelCase	)
							return cipher, key




				@staticmethod
				def 	__a		(   _UpperCamelCase							,							_UpperCamelCase	)							-> str:
							lowerCAmelCase_         =      []
							for i in range(len(_UpperCamelCase	)	):
										lowerCAmelCase_         =      int((cipher[i] - (key[i]) ** 2) / key[i]	)
										plain.append(chr(_UpperCamelCase	)	)
							return "".join(_UpperCamelCase	)


if __name__ == "__main__":
			_A, _A  =	Onepad().encrypt("Hello")
			print(c, k)
			print(Onepad().decrypt(c, k))





from collections.abc import Callable






def   lowerCamelCase__							(							__lowerCAmelCase    :    Callable[[float], float]       ,				__lowerCAmelCase    :    float       ,				__lowerCAmelCase    :    float							):




			"""simple docstring"""


			lowerCAmelCase_         =      a
			lowerCAmelCase_         =      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:
						lowerCAmelCase_         =      start + (end - start) / 2.0
						while abs(start - mid							) > 10**-7:  # until precisely equals to 10^-7
									if function(__lowerCAmelCase							) == 0:
												return mid
									elif function(__lowerCAmelCase							) * function(__lowerCAmelCase							) < 0:
												lowerCAmelCase_         =      mid
									else:
												lowerCAmelCase_         =      mid
									lowerCAmelCase_         =      start + (end - start) / 2.0
						return mid






def   lowerCamelCase__							(							__lowerCAmelCase    :    float							):




			"""simple docstring"""


			return x**3 - 2 * x - 5


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

			import doctest

			doctest.testmod()



