
from __future__ import annotations







def 						_snake_case(  SCREAMING_SNAKE_CASE__    )			->   list[int]:
       lowercase							:					str	     =				2
       lowercase							:					List[str]	     =				[]
       while i * i <= n:
              if n % i:
                     i += 1
              else:
                     n //= i
                     factors.append(SCREAMING_SNAKE_CASE__    )
       if n > 1:
              factors.append(SCREAMING_SNAKE_CASE__    )
       return factors


if __name__ == "__main__":
  import doctest

  doctest.testmod()


from bisect import bisect
from itertools import accumulate







def 						_snake_case(  SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    )			->   Optional[int]:
       lowercase							:					Dict	     =				sorted(zip(SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    ) ,     key=lambda SCREAMING_SNAKE_CASE__    : x[0] / x[1] ,     reverse=SCREAMING_SNAKE_CASE__    )
       lowercase     ,      lowercase							:					Optional[Any]	     =				[i[0] for i in r], [i[1] for i in r]
       lowercase							:					Any	     =				list(accumulate(SCREAMING_SNAKE_CASE__    )    )
       lowercase							:					int	     =				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()
