



from bisect import bisect
from itertools import accumulate



def    _lowerCAmelCase    (_lowerCAmelCase   ,	_lowerCAmelCase   ,	_lowerCAmelCase   ,	_lowerCAmelCase):
					UpperCamelCase_		  =   sorted(zip(_lowerCAmelCase   ,	_lowerCAmelCase)   ,	key=lambda _lowerCAmelCase: x[0] / x[1]   ,	reverse=_lowerCAmelCase)
					UpperCamelCase_  ,    UpperCamelCase_		  =   [i[0] for i in r], [i[1] for i in r]
					UpperCamelCase_		  =   list(accumulate(_lowerCAmelCase))
					UpperCamelCase_		  =   bisect(_lowerCAmelCase   ,	_lowerCAmelCase)
					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    _lowerCAmelCase    (_lowerCAmelCase = 60_08_51_47_51_43):

					try:
										UpperCamelCase_		  =   int(_lowerCAmelCase)
					except (TypeError, ValueError):
										raise TypeError("Parameter n must be int or castable to int.")
					if n <= 0:
										raise ValueError("Parameter n must be greater than or equal to one.")
					UpperCamelCase_		  =   1
					UpperCamelCase_		  =   2
					while i * i <= n:
										while n % i == 0:
															UpperCamelCase_		  =   i
															n //= i
										i += 1
					if n > 1:
										UpperCamelCase_		  =   n
					return int(_lowerCAmelCase)


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