




'''simple docstring'''





class      UpperCamelCase       :



  def __init__(			self		,     __lowerCAmelCase ):







      '''simple docstring'''


      _a				:							Optional[int]							       =      data
      _a				:							Union[str, Any]							       =      None
      _a				:							Union[str, Any]							       =      None



  def __str__(			self ):







      '''simple docstring'''


      return f'''{self.data}'''






class      UpperCamelCase       :



  def __init__(			self ):







      '''simple docstring'''


      _a				:							Union[str, Any]							       =      None
      _a				:							Union[str, Any]							       =      None



  def __iter__(			self ):







      '''simple docstring'''


      _a				:							Union[str, Any]							       =      self.head
      while node:
          yield node.data
          _a				:							Union[str, Any]							       =      node.next



  def __str__(			self ):







      '''simple docstring'''


      return "->".join([str(__lowerCAmelCase ) for item in self] )



  def __len__(			self ):







      '''simple docstring'''


      return sum(1 for _ in self )



  def     a_							(			self		,     __lowerCAmelCase ):







      '''simple docstring'''


      self.insert_at_nth(0		,     __lowerCAmelCase )



  def     a_							(			self		,     __lowerCAmelCase ):







      '''simple docstring'''


      self.insert_at_nth(len(self )		,     __lowerCAmelCase )



  def     a_							(			self		,     __lowerCAmelCase		,     __lowerCAmelCase ):







      '''simple docstring'''


      _a				:							List[Any]							       =      len(self )

      if not 0 <= index <= length:
          raise IndexError("""list index out of range""" )
      _a				:							Dict							       =      Node(__lowerCAmelCase )
      if self.head is None:
          _a				:							int							       =      new_node
      elif index == 0:
          _a				:							List[Any]							       =      new_node
          _a				:							List[str]							       =      self.head
          _a				:							Dict							       =      new_node
      elif index == length:
          _a				:							Optional[int]							       =      new_node
          _a				:							List[str]							       =      self.tail
          _a				:							Optional[int]							       =      new_node
      else:
          _a				:							str							       =      self.head
          for _ in range(0		,     __lowerCAmelCase ):
              _a				:							str							       =      temp.next
          _a				:							int							       =      new_node
          _a				:							List[Any]							       =      temp.previous
          _a				:							Optional[int]							       =      temp
          _a				:							str							       =      new_node



  def     a_							(			self ):







      '''simple docstring'''


      return self.delete_at_nth(0 )



  def     a_							(			self ):







      '''simple docstring'''


      return self.delete_at_nth(len(self ) - 1 )



  def     a_							(			self		,     __lowerCAmelCase ):







      '''simple docstring'''


      _a				:							Union[str, Any]							       =      len(self )

      if not 0 <= index <= length - 1:
          raise IndexError("""list index out of range""" )
      _a				:							str							       =      self.head  # default first node
      if length == 1:
          _a				:							List[str]							       =      None
      elif index == 0:
          _a				:							str							       =      self.head.next
          _a				:							List[str]							       =      None
      elif index == length - 1:
          _a				:							Any							       =      self.tail
          _a				:							int							       =      self.tail.previous
          _a				:							Union[str, Any]							       =      None
      else:
          _a				:							str							       =      self.head
          for _ in range(0		,     __lowerCAmelCase ):
              _a				:							Tuple							       =      temp.next
          _a				:							Dict							       =      temp
          _a				:							Dict							       =      temp.previous
          _a				:							Optional[int]							       =      temp.next
      return delete_node.data



  def     a_							(			self		,     __lowerCAmelCase ):







      '''simple docstring'''


      _a				:							Tuple							       =      self.head

      while current.data != data:  # Find the position to delete
          if current.next:
              _a				:							Optional[Any]							       =      current.next
          else:  # We have reached the end an no value matches
              raise ValueError("""No data matching given value""" )

      if current == self.head:
          self.delete_head()

      elif current == self.tail:
          self.delete_tail()

      else:  # Before: 1 <--> 2(current) <--> 3
          _a				:							Tuple							       =      current.next  # 1 --> 3
          _a				:							str							       =      current.previous  # 1 <--> 3
      return data



  def     a_							(			self ):







      '''simple docstring'''


      return len(self ) == 0






def UpperCAmelCase    (       ):
    _a				:							Any							       =      DoublyLinkedList()
    assert linked_list.is_empty() is True
    assert str(UpperCAmelCase_						) == ""

    try:
        linked_list.delete_head()
        raise AssertionError  # This should not happen.
    except IndexError:
        assert True  # This should happen.

    try:
        linked_list.delete_tail()
        raise AssertionError  # This should not happen.
    except IndexError:
        assert True  # This should happen.

    for i in range(10						):
        assert len(UpperCAmelCase_						) == i
        linked_list.insert_at_nth(UpperCAmelCase_   ,	i + 1						)
    assert str(UpperCAmelCase_						) == "->".join(str(UpperCAmelCase_						) for i in range(1   ,	11						)						)

    linked_list.insert_at_head(0						)
    linked_list.insert_at_tail(11						)
    assert str(UpperCAmelCase_						) == "->".join(str(UpperCAmelCase_						) for i in range(0   ,	12						)						)

    assert linked_list.delete_head() == 0
    assert linked_list.delete_at_nth(9						) == 10
    assert linked_list.delete_tail() == 11
    assert len(UpperCAmelCase_						) == 9
    assert str(UpperCAmelCase_						) == "->".join(str(UpperCAmelCase_						) for i in range(1   ,	10						)						)


if __name__ == "__main__":
  from doctest import testmod

  testmod()






from itertools import count
from math import asin, pi, sqrt
def 				UpperCamelCase_	(					__snake_case      :    float  )->   float:




						'''simple docstring'''
						return (
						    (1 - 2 * point) * sqrt(point - point**2  ) + 2 * point + asin(sqrt(1 - point  )  )
						) / 4
def 				UpperCamelCase_	(					__snake_case      :    int  )->   float:




						'''simple docstring'''
						__magic_name__					=      (circles_number + 1 - sqrt(2 * circles_number  )) / (
						    2 * (circles_number**2 + 1)
						)
						__magic_name__					=      circles_number * intersection_y

						__magic_name__					=      intersection_x * intersection_y / 2
						__magic_name__					=      circle_bottom_arc_integral(
						    1 / 2  ) - circle_bottom_arc_integral(__snake_case  )

						return triangle_area + concave_region_area
def 				UpperCamelCase_	(					__snake_case      :    float = 1 / 10_00  )->   int:




						'''simple docstring'''
						__magic_name__					=      (1 - pi / 4) / 4

						for n in count(1  ):
												if concave_triangle_area(__snake_case  ) / l_section_area < fraction:
																		return n

						return -1


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

