





from bisect import bisect
from itertools import accumulate



def        __lowercase       (				_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE     ):


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						sorted(zip(_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE     )			,						key=lambda _SCREAMING_SNAKE_CASE     : x[0] / x[1]			,						reverse=_SCREAMING_SNAKE_CASE     )
      SCREAMING_SNAKE_CASE, SCREAMING_SNAKE_CASE		=						[i[0] for i in r], [i[1] for i in r]
      SCREAMING_SNAKE_CASE		=						list(accumulate(_SCREAMING_SNAKE_CASE     )     )
      SCREAMING_SNAKE_CASE		=						bisect(_SCREAMING_SNAKE_CASE			,						_SCREAMING_SNAKE_CASE     )
      return (
          0
          if k == 0
          else sum(vl[:k]     ) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
          if k != n
          else sum(vl[:k]     )
      )


if __name__ == "__main__":
      import doctest

      doctest.testmod()









def        __lowercase       (				_SCREAMING_SNAKE_CASE = 1			,						_SCREAMING_SNAKE_CASE = 10_00     )			->       int:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						1
      SCREAMING_SNAKE_CASE		=						0

      for divide_by_number in range(_SCREAMING_SNAKE_CASE			,						digit + 1     ):
            SCREAMING_SNAKE_CASE		=						[]
            SCREAMING_SNAKE_CASE		=						numerator
            for _ in range(1			,						digit + 1     ):
                  if now_divide in has_been_divided:
                        if longest_list_length < len(_SCREAMING_SNAKE_CASE     ):
                              SCREAMING_SNAKE_CASE		=						len(_SCREAMING_SNAKE_CASE     )
                              SCREAMING_SNAKE_CASE		=						divide_by_number
                  else:
                        has_been_divided.append(_SCREAMING_SNAKE_CASE     )
                        SCREAMING_SNAKE_CASE		=						now_divide * 10 % divide_by_number

      return the_digit


# Tests
if __name__ == "__main__":
      import doctest

      doctest.testmod()


