




from __future__ import annotations







def 		_A(       UpperCamelCase__							:			list[float]				,       UpperCamelCase__							:			list[float]				)    -> float:
							'''simple docstring'''


							__lowercase      =    sorted(numsa + numsa				)
							__lowercase     ,     __lowercase      =    divmod(len(UpperCamelCase__				)				,       2				)
							if mod == 1:
														return all_numbers[div]
							else:
														return (all_numbers[div] + all_numbers[div - 1]) / 2


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			UpperCAmelCase__				     = [float(x) for x in input("Enter the elements of first array: ").split()]
			UpperCAmelCase__				     = [float(x) for x in input("Enter the elements of second array: ").split()]
			print(F"""The median of two arrays is: {median_of_two_arrays(array_a, array_a)}""")












from __future__ import annotations







def 		_A(       UpperCamelCase__							:			list[int]				,       UpperCamelCase__							:			list[int]				,       UpperCamelCase__							:			int				)    -> tuple[float, list[float]]:
							'''simple docstring'''


							__lowercase      =    list(range(len(UpperCamelCase__				)				)				)
							__lowercase      =    [v / w for v, w in zip(UpperCamelCase__				,       UpperCamelCase__				)]
							index.sort(key=lambda UpperCamelCase__				: ratio[i]				,       reverse=UpperCamelCase__				)

							__lowercase      =    0
							__lowercase      =    [0] * len(UpperCamelCase__				)
							for i in index:
														if weight[i] <= capacity:
																					__lowercase      =    1
																					max_value += value[i]
																					capacity -= weight[i]
														else:
																					__lowercase      =    capacity / weight[i]
																					max_value += value[i] * capacity / weight[i]
																					break

							return max_value, fractions


if __name__ == "__main__":
			import doctest

			doctest.testmod()






