


'''simple docstring'''

from bisect import bisect
from itertools import accumulate





def __snake_case   ( UpperCAmelCase_		:		Optional[int]   ,							UpperCAmelCase_		:		Optional[int]   ,							UpperCAmelCase_		:		int   ,							UpperCAmelCase_		:		Optional[Any]						):
 lowerCamelCase_						=    sorted(zip(__a   ,							__a						)   ,							key=lambda UpperCAmelCase_						: x[0] / x[1]   ,							reverse=__a						)
 lowerCamelCase_						=    [i[0] for i in r], [i[1] for i in r]
 lowerCamelCase_						=    list(accumulate(__a						)						)
 lowerCamelCase_						=    bisect(__a   ,							__a						)
 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()








"""simple docstring"""







def     UpperCAmelCase_					(				):




			'''simple docstring'''



			_lowerCamelCase					:					str	       =    0
			for i in range(1      ,							10_01						):
						total += i**i
			return str(__a						)[-10:]


if __name__ == "__main__":
	print(solution())





