

'''simple docstring'''

from __future__ import annotations





def  A_	(			snake_case   ,							snake_case   ,							snake_case			):
  SCREAMING_SNAKE_CASE:str       =       list(range(len(snake_case			)			)			)
  SCREAMING_SNAKE_CASE:Any       =       [v / w for v, w in zip(snake_case   ,							snake_case			)]
  index.sort(key=lambda snake_case			: ratio[i]   ,							reverse=snake_case			)

  SCREAMING_SNAKE_CASE:float       =       0
  SCREAMING_SNAKE_CASE:list[float]       =       [0] * len(snake_case			)
  for i in index:
    if weight[i] <= capacity:
      SCREAMING_SNAKE_CASE:List[Any]       =       1
      max_value += value[i]
      capacity -= weight[i]
    else:
      SCREAMING_SNAKE_CASE:str       =       capacity / weight[i]
      max_value += value[i] * capacity / weight[i]
      break

  return max_value, fractions


if __name__ == "__main__":
    import doctest

    doctest.testmod()







"""simple docstring"""



from __future__ import annotations

def  _A(		lowerCAmelCase							):
							if len(lowerCAmelCase							) == 0:
														return []
							A__				,							A__       :     Dict								=			min(lowerCAmelCase							), max(lowerCAmelCase							)
							A__       :     List[Any]								=			int(max_value - min_value							) + 1
							A__       :     list[list]								=			[[] for _ in range(lowerCAmelCase							)]

							for i in my_list:
														buckets[int(i - min_value							)].append(lowerCAmelCase							)

							return [v for bucket in buckets for v in sorted(lowerCAmelCase							)]


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

				testmod()
				assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
				assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]





