'''simple docstring'''

from __future__ import annotations







def __UpperCamelCase( _A       :					list[int]	,      _A       :					list[int]	,      _A       :					int     ):
   '''simple docstring'''
   UpperCAmelCase__				:					List[Any] 					=	list(range(len(_A     )     )     )
   UpperCAmelCase__				:					Optional[int] 					=	[v / w for v, w in zip(_A	,      _A     )]
   index.sort(key=lambda _A     : ratio[i]	,      reverse=_A     )

   UpperCAmelCase__				:					float 					=	0
   UpperCAmelCase__				:					list[float] 					=	[0] * len(_A     )
   for i in index:
      if weight[i] <= capacity:
         UpperCAmelCase__				:					Optional[Any] 					=	1
         max_value += value[i]
         capacity -= weight[i]
      else:
         UpperCAmelCase__				:					Union[str, Any] 					=	capacity / weight[i]
         max_value += value[i] * capacity / weight[i]
         break

   return max_value, fractions


if __name__ == "__main__":
  import doctest

  doctest.testmod()





'''simple docstring'''

import baseaa







def __UpperCamelCase( _A       :					str     ):
   '''simple docstring'''
   return baseaa.baaencode(string.encode('''utf-8'''     )     )







def __UpperCamelCase( _A       :					bytes     ):
   '''simple docstring'''
   return baseaa.baadecode(_A     ).decode('''utf-8'''     )


if __name__ == "__main__":
  UpperCamelCase__  :						List[str]					=      'Hello World!'
  UpperCamelCase__  :						str					=      baseaa_encode(test)
  print(encoded)

  UpperCamelCase__  :						int					=      baseaa_decode(encoded)
  print(decoded)




