






from math import isclose, sqrt






def   UpperCamelCase  (       snake_case__     :   Optional[int]	,snake_case__     :   List[Any]	,snake_case__     :   Tuple  ):




     '''simple docstring'''






     __snake_case			:Dict          =						point_y / 4 / point_x
     __snake_case			:List[str]          =						2 * normal_gradient / (1 + normal_gradient * normal_gradient)
     __snake_case			:List[Any]          =						(1 - normal_gradient * normal_gradient) / (
         1 + normal_gradient * normal_gradient
     )
     __snake_case			:Union[str, Any]          =						(sa - ca * incoming_gradient) / (ca + sa * incoming_gradient)

     # to find the next point, solve the simultaeneous equations:
     # y^2 + 4x^2 = 100
     # y - b = m * (x - a)
     # ==> A x^2 + B x + C = 0
     __snake_case			:Tuple          =						outgoing_gradient**2 + 4
     __snake_case			:Optional[int]          =						2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
     __snake_case			:Optional[int]          =						(point_y - outgoing_gradient * point_x) ** 2 - 100

     __snake_case			:str          =						(
         -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term  )
     ) / (2 * quadratic_term)
     __snake_case			:Optional[int]          =						(
         -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term  )
     ) / (2 * quadratic_term)

     # two solutions, one of which is our input point
     __snake_case			:List[str]          =						x_minus if isclose(__lowerCAmelCase	,__lowerCAmelCase  ) else x_plus
     __snake_case			:Tuple          =						point_y + outgoing_gradient * (next_x - point_x)

     return next_x, next_y, outgoing_gradient






def   UpperCamelCase  (       snake_case__     :   Union[str, Any] = 1.4	,snake_case__     :   List[str] = -9.6  ):




     '''simple docstring'''






     __snake_case			:int          =						0
     __snake_case			:float          =						first_x_coord
     __snake_case			:float          =						first_y_coord
     __snake_case			:float          =						(10.1 - point_y) / (0.0 - point_x)

     while not (-0.0_1 <= point_x <= 0.0_1 and point_y > 0):
          __snake_case			:str          =						next_point(__lowerCAmelCase	,__lowerCAmelCase	,__lowerCAmelCase  )
          num_reflections += 1

     return num_reflections


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










def   UpperCamelCase  (       snake_case__     :   str	,snake_case__     :   int  ):




     '''simple docstring'''






     __snake_case			:list[list[str]]          =						[[] for _ in range(snake_case__  )]
     __snake_case			:Union[str, Any]          =						key - 1

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

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

     return output_string






def   UpperCamelCase  (       snake_case__     :   str	,snake_case__     :   int  ):




     '''simple docstring'''






     __snake_case			:Union[str, Any]          =						[]
     __snake_case			:Optional[int]          =						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(snake_case__  )]  # generates template
     for position in range(len(snake_case__  )  ):
          __snake_case			:List[str]          =						position % (lowest * 2)  # puts it in bounds
          __snake_case			:int          =						min(snake_case__	,lowest * 2 - num  )  # creates zigzag pattern
          temp_grid[num].append("""*"""  )

     __snake_case			:str          =						0
     for row in temp_grid:  # fills in the characters
          __snake_case			:str          =						input_string[counter : counter + len(snake_case__  )]
          grid.append(list(snake_case__  )  )
          counter += len(snake_case__  )

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






def   UpperCamelCase  (       snake_case__     :   str  ):




     '''simple docstring'''






     __snake_case			:Optional[Any]          =						{}
     for key_guess in range(1	,len(snake_case__  )  ):  # tries every key
          __snake_case			:Dict          =						decrypt(snake_case__	,snake_case__  )
     return results


if __name__ == "__main__":
     import doctest

     doctest.testmod()


