

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





      """simple docstring"""



      return (
          (1 - 2 * point) * sqrt(point - point**2					) + 2 * point + asin(sqrt(1 - point					)					)
      ) / 4
def 					a				(      A__     :       int					)   ->				float:





      """simple docstring"""



      _lowercase     	=(circles_number + 1 - sqrt(2 * circles_number					)) / (
          2 * (circles_number**2 + 1)
      )
      _lowercase     	=circles_number * intersection_y

      _lowercase     	=intersection_x * intersection_y / 2
      _lowercase     	=circle_bottom_arc_integral(
          1 / 2					) - circle_bottom_arc_integral(A__					)

      return triangle_area + concave_region_area
def 					a				(      A__     :       float = 1 / 1000					)   ->				int:





      """simple docstring"""



      _lowercase     	=(1 - pi / 4) / 4

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

      return -1


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





import unittest

from cer import CER


lowercase_     =       CER()





class 			__lowerCAmelCase					( unittest.TestCase							):




  def   A__					(    self )  ->			Any:
        '''simple docstring'''






        _lowercase     	=['White House']
        _lowercase     	=['white house']
        # S = 2, D = 0, I = 0, N = 11, CER = 2 / 11
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.1818181818 ) < 1e-6 )




  def   A__					(    self )  ->			Dict:
        '''simple docstring'''






        _lowercase     	=['were wolf']
        _lowercase     	=['werewolf']
        # S = 0, D = 0, I = 1, N = 9, CER = 1 / 9
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.1111111 ) < 1e-6 )

        _lowercase     	=['werewolf']
        _lowercase     	=['weae     wolf']
        # S = 1, D = 1, I = 0, N = 8, CER = 0.25
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.25 ) < 1e-6 )

        # consecutive whitespaces case 1
        _lowercase     	=['were wolf']
        _lowercase     	=['were               wolf']
        # S = 0, D = 0, I = 0, N = 9, CER = 0
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.0 ) < 1e-6 )

        # consecutive whitespaces case 2
        _lowercase     	=['were   wolf']
        _lowercase     	=['were               wolf']
        # S = 0, D = 0, I = 0, N = 9, CER = 0
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.0 ) < 1e-6 )




  def   A__					(    self )  ->			Optional[Any]:
        '''simple docstring'''






        _lowercase     	=['werewolf']
        _lowercase     	=['weaewolf']
        # S = 1, D = 0, I = 0, N = 8, CER = 0.125
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.125 ) < 1e-6 )




  def   A__					(    self )  ->			Union[str, Any]:
        '''simple docstring'''






        _lowercase     	=['werewolf']
        _lowercase     	=['wereawolf']
        # S = 0, D = 1, I = 0, N = 8, CER = 0.125
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.125 ) < 1e-6 )




  def   A__					(    self )  ->			Any:
        '''simple docstring'''






        _lowercase     	=['werewolf']
        _lowercase     	=['wereolf']
        # S = 0, D = 0, I = 1, N = 8, CER = 0.125
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.125 ) < 1e-6 )




  def   A__					(    self )  ->			Any:
        '''simple docstring'''






        _lowercase     	=['werewolf']
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertEqual(lowerCAmelCase							,       0.0 )




  def   A__					(    self )  ->			List[Any]:
        '''simple docstring'''






        _lowercase     	=['werewolf', 'I am your father']
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertEqual(lowerCAmelCase							,       0.0 )

        _lowercase     	=['werewolf', 'I am your father', 'doge']
        _lowercase     	=['werxwolf', 'I       am your father', 'doge']
        # S = 1, D = 0, I = 0, N = 28, CER = 1 / 28
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.03571428 ) < 1e-6 )




  def   A__					(    self )  ->			str:
        '''simple docstring'''






        _lowercase     	=['My hovercraft', 'is full of eels']
        _lowercase     	=['My hovercraft is full', ' of eels']
        # S = 0, D = 0, I = 2, N = 28, CER = 2 / 28
        # whitespace at the front of " of eels" will be strip during preporcessing
        # so need to insert 2 whitespaces
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase							,       concatenate_texts=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.071428 ) < 1e-6 )




  def   A__					(    self )  ->			Union[str, Any]:
        '''simple docstring'''






        _lowercase     	=['我能吞下玻璃而不伤身体']
        _lowercase     	=[' 能吞虾玻璃而 不霜身体啦']
        # S = 3, D = 2, I = 0, N = 11, CER = 5 / 11
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.4545454545 ) < 1e-6 )

        _lowercase     	=['我能吞下玻璃', '而不伤身体']
        _lowercase     	=['我    能 吞 下 玻 璃', '而不伤身体']
        # S = 0, D = 5, I = 0, N = 11, CER = 5 / 11
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertTrue(abs(char_error_rate - 0.454545454545 ) < 1e-6 )

        _lowercase     	=['我能吞下玻璃而不伤身体']
        _lowercase     	=cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )
        self.assertFalse(lowerCAmelCase							,       0.0 )




  def   A__					(    self )  ->			List[str]:
        '''simple docstring'''






        _lowercase     	=['']
        _lowercase     	=['Hypothesis']
        with self.assertRaises(lowerCAmelCase ):
              cer.compute(predictions=lowerCAmelCase							,       references=lowerCAmelCase )


if __name__ == "__main__":
  unittest.main()


