





from bisect import bisect
from itertools import accumulate




def _a (  SCREAMING_SNAKE_CASE__      :  Dict			,				SCREAMING_SNAKE_CASE__      :  Any			,				SCREAMING_SNAKE_CASE__      :  Dict			,				SCREAMING_SNAKE_CASE__      :  int       )	->    Dict:

							'''simple docstring'''






							SCREAMING_SNAKE_CASE__       :      Tuple     =						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__       :      Optional[int]     =						[i[0] for i in r], [i[1] for i in r]
							SCREAMING_SNAKE_CASE__       :      int     =						list(accumulate(SCREAMING_SNAKE_CASE__       )       )
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						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 _a (  SCREAMING_SNAKE_CASE__      :  str       )	->    str:

							'''simple docstring'''






							if not all(char in "01" for char in bin_string       ):
														raise ValueError("Non-binary value was passed to the function"       )
							if not bin_string:
														raise ValueError("Empty string was passed to the function"       )
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						""
							while len(SCREAMING_SNAKE_CASE__       ) % 3 != 0:
														SCREAMING_SNAKE_CASE__       :      str     =						"0" + bin_string
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						[
							    bin_string[index : index + 3]
							    for index in range(len(SCREAMING_SNAKE_CASE__       )       )
							    if index % 3 == 0
							]
							for bin_group in bin_string_in_3_list:
														SCREAMING_SNAKE_CASE__       :      List[Any]     =						0
														for index, val in enumerate(SCREAMING_SNAKE_CASE__       ):
																					oct_val += int(2 ** (2 - index) * int(SCREAMING_SNAKE_CASE__       )       )
														oct_string += str(SCREAMING_SNAKE_CASE__       )
							return oct_string


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

		testmod()






