Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization. There are n people who plan to move to the cities. The wealth of the i of them is equal to a_{i}. Authorities plan to build two cities, first for n_1 people and second for n_2 people. Of course, each of n candidates can settle in only one of the cities. Thus, first some subset of candidates of size n_1 settle in the first city and then some subset of size n_2 is chosen among the remaining candidates and the move to the second city. All other candidates receive an official refuse and go back home.

To make the statistic of local region look better in the eyes of their bosses, local authorities decided to pick subsets of candidates in such a way that the sum of arithmetic mean of wealth of people in each of the cities is as large as possible. Arithmetic mean of wealth in one city is the sum of wealth a_{i} among all its residents divided by the number of them (n_1 or n_2 depending on the city). The division should be done in real numbers without any rounding.

Please, help authorities find the optimal way to pick residents for two cities.


-----Input-----

The first line of the input contains three integers n, n_1 and n_2 (1 ≤ n, n_1, n_2 ≤ 100 000, n_1 + n_2 ≤ n) — the number of candidates who want to move to the cities, the planned number of residents of the first city and the planned number of residents of the second city.

The second line contains n integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 100 000), the i-th of them is equal to the wealth of the i-th candidate.


-----Output-----

Print one real value — the maximum possible sum of arithmetic means of wealth of cities' residents. You answer will be considered correct if its absolute or relative error does not exceed 10^{ - 6}. 

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if $\frac{|a - b|}{\operatorname{max}(1, b)} \leq 10^{-6}$.


-----Examples-----
Input
2 1 1
1 5

Output
6.00000000

Input
4 2 1
1 4 2 3

Output
6.50000000



-----Note-----

In the first sample, one of the optimal solutions is to move candidate 1 to the first city and candidate 2 to the second.

In the second sample, the optimal solution is to pick candidates 3 and 4 for the first city, and candidate 2 for the second one. Thus we obtain (a_3 + a_4) / 2 + a_2 = (3 + 2) / 2 + 4 = 6.5

Source: codeforces | Difficulty: EASY
Tags: Number theory

Sorting

Greedy algorithms


Solutions:
cases = input().split()
n = int(cases[0])
n1 = int(cases[1])
n2 = int(cases[2])
array = input().split()
array = [int(x) for x in array]
array.sort()
less = min(n1, n2)
more = max(n1, n2)
sum1 = 0
sum2 = 0
for i in range(n - less, n):
	sum1 += array[i]
for j in range(n - less - more, n - less):
	sum2 += array[j]
result = sum1 / less + sum2 / more
print(result)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a.reverse()
if n1 > n2:
	(n1, n2) = (n2, n1)
ans = 0
for i in range(0, n1):
	ans += n2 * a[i]
for i in range(n1, n1 + n2):
	ans += n1 * a[i]
ans = ans / (n1 * n2)
print(ans)


(n, a, b) = map(int, input().split())
(l, c, d, sum) = (list(map(int, input().split())), 0, 0, 0)
if a > b:
	(a, b) = (b, a)
l.sort()
for i in range(n - 1, -1, -1):
	sum += l[i]
	c += 1
	if c == a:
		break
(c, sum) = (sum / a, 0)
for i in range(n - a - 1, -1, -1):
	sum += l[i]
	d += 1
	if d == b:
		break
print(sum / b + c)


(n, n1, n2) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
l.reverse()
if n1 <= n2:
	m1 = sum(l[:n1]) / n1
	m2 = sum(l[n1:n1 + n2]) / n2
else:
	m1 = sum(l[:n2]) / n2
	m2 = sum(l[n2:n1 + n2]) / n1
print(m1 + m2)


(n, n1, n2) = map(int, input().split())
a = sorted([int(x) for x in input().split()], reverse=True)
s1 = 0
s2 = 0
mn = min(n1, n2)
mx = max(n1, n2)
for i in range(mn):
	s1 += a[i]
for i in range(mn, mx + mn):
	s2 += a[i]
print(format(s1 / mn + s2 / mx, '.8f'))


(n, n1, n2) = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = 0
if n1 > n2:
	ans1 = 0
	for i in range(n2):
		ans1 += l[i]
	ans2 = 0
	for j in range(n2, n1 + n2):
		ans2 += l[j]
	ans = ans1 / n2 + ans2 / n1
else:
	ans1 = 0
	for i in range(n1):
		ans1 += l[i]
	ans2 = 0
	for j in range(n1, n1 + n2):
		ans2 += l[j]
	ans = ans1 / n1 + ans2 / n2
print(ans)


def main():
	(n, n1, n2) = list(map(int, input().split()))
	if n1 > n2:
		(n1, n2) = (n2, n1)
	aa = sorted(map(int, input().split()), reverse=True)
	print(sum(aa[:n1]) / n1 + sum(aa[n1:n1 + n2]) / n2)

def __starting_point():
	main()
__starting_point()


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
if n1 < n2:
	(n1, n2) = (n2, n1)
b = []
c = []
a = a[::-1]
for i in range(n2):
	b.append(a[i])
for i in range(n2, n2 + n1):
	c.append(a[i])
ans = sum(b) / len(b) + sum(c) / len(c)
print(ans)


import math
(n, n1, n2) = [int(x) for x in input().split()]
(n1, n2) = (min(n1, n2), max(n1, n2))
s = [int(x) for x in input().split()]
s.sort()
s.reverse()
s1 = s[:n1]
s2 = s[n1:n1 + n2]
print(sum(s1) / n1 + sum(s2) / n2)


(n, n1, n2) = map(int, input().split())
c = map(int, input().split())
c = list(c)
c.sort(reverse=True)
if n1 > n2:
	(n1, n2) = (n2, n1)
print(sum(c[:n1]) / n1 + sum(c[n1:n1 + n2]) / n2)


(n, k1, k2) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
l.reverse()
if k1 > k2:
	t = k1
	k1 = k2
	k2 = t
x = 0
y = 0
for i in range(0, k1 + k2):
	if i >= k1:
		y += l[i]
	else:
		x += l[i]
x /= k1
y /= k2
print(x + y)


(n, n1, n2) = list(map(int, input().split()))
values = sorted(map(int, input().split()), key=lambda x: -x)
if n1 > n2:
	(n1, n2) = (n2, n1)
g1 = values[:n1]
g2 = values[n1:n1 + n2]
print(sum(g1) / n1 + sum(g2) / n2)


def cin():
	return list(map(int, input().split()))
s = 0
(n, a, b) = cin()
A = cin()
A = sorted(A)[::-1]
if a > b:
	s = sum(A[:b]) / b + sum(A[b:b + a]) / a
else:
	s = sum(A[:a]) / a + sum(A[a:a + b]) / b
print(s)


(n, m, o) = map(int, input().split())
l_n = list(map(float, input().split()))
l_n.sort(reverse=True)
w = [0] * 2
i = 0
if m > o:
	(o, m) = (m, o)
while i < m + o:
	if i >= m:
		w[1] += l_n[i]
	else:
		w[0] += l_n[i]
	i += 1
print(w[0] / m + w[1] / o)


(n, M, m) = map(int, input().split())
if M < m:
	(M, m) = (m, M)
al = sorted(list(map(int, input().split())), reverse=True)
avg1 = sum(al[0:m]) / m
avg2 = sum(al[m:M + m]) / M
print(avg1 + avg2)


(n, n1, n2) = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
(n1, n2) = (min(n1, n2), max(n1, n2))
a1 = sum(a[0:n1]) / n1
a2 = sum(a[n1:n1 + n2]) / n2
print(a1 + a2)


(n, n1, n2) = map(int, input().split())
lt = list(map(int, input().split()))
lt.sort(reverse=True)
k1 = 0
k2 = 0
s1 = 0
s2 = 0
nMin = min(n1, n2)
nMax = max(n1, n2)
for i in range(nMin):
	s1 += lt[k1]
	k1 += 1
k2 = k1
for i in range(nMax):
	s2 += lt[k2]
	k2 += 1
s1 = round(s1 / k1, 8)
s2 = round(s2 / (k2 - k1), 8)
print('{:.8f}'.format(s1 + s2))


import math, sys, re, itertools, pprint, collections, copy
(rs, ri, rai, raf) = (input, lambda : int(input()), lambda : list(map(int, input().split())), lambda : list(map(float, input().split())))
(n, n1, n2) = rai()
a = rai()
a.sort(reverse=True)
if n1 < n2:
	print(sum(a[:n1]) / n1 + sum(a[n1:n1 + n2]) / n2)
else:
	print(sum(a[:n2]) / n2 + sum(a[n2:n2 + n1]) / n1)


def optimal_separate(n, n1, n2, arr):
	arr = sorted(arr)
	if n1 < n2:
		city_1 = sum(arr[-n1:]) / n1
		arr = arr[:-n1]
		city_2 = sum(arr[-n2:]) / n2
	else:
		city_1 = sum(arr[-n2:]) / n2
		arr = arr[:-n2]
		city_2 = sum(arr[-n1:]) / n1
	return city_1 + city_2
(n, n1, n2) = [int(k) for k in input().strip().split(' ')]
arr = [int(k) for k in input().strip().split(' ')]
print(optimal_separate(n, n1, n2, arr))


(n, n1, n2) = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
(n1, n2) = (min(n1, n2), max(n1, n2))
print('{0:.6f}'.format(sum(a[0:n1]) / n1 + sum(a[n1:n1 + n2]) / n2))


(n, n1, n2) = map(int, input().split())
a = []
a = list(map(int, input().split()))
a.sort(reverse=True)
sum1 = 0
sum2 = 0
for i in range(min(n1, n2)):
	sum1 += a[i]
for i in range(min(n1, n2), n1 + n2):
	sum2 += a[i]
print(sum1 / min(n1, n2) + sum2 / max(n1, n2))


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
if n1 <= n2:
	a1 = 0
	c1 = 0
	for j in range(len(a) - 1, -1, -1):
		if c1 >= n1:
			break
		else:
			a1 = a1 + a[j]
			c1 = c1 + 1
	a1 = a1 / n1
	a2 = 0
	c2 = 0
	for i in range(j, -1, -1):
		if c2 >= n2:
			break
		else:
			a2 = a2 + a[i]
			c2 = c2 + 1
	a2 = a2 / n2
	print(a1 + a2)
else:
	a1 = 0
	c1 = 0
	for j in range(len(a) - 1, -1, -1):
		if c1 >= n2:
			break
		else:
			a1 = a1 + a[j]
			c1 = c1 + 1
	a1 = a1 / n2
	a2 = 0
	c2 = 0
	for i in range(j, -1, -1):
		if c2 >= n1:
			break
		else:
			a2 = a2 + a[i]
			c2 = c2 + 1
	a2 = a2 / n1
	print(a1 + a2)


(n, n1, n2) = map(int, input().split())
a = sorted([int(x) for x in input().split()], reverse=True)
if n1 > n2:
	(n1, n2) = (n2, n1)
ans = 0
for i in range(n1):
	ans += a[i] / n1
for i in range(n1, n1 + n2):
	ans += a[i] / n2
print(ans)


Input = list(map(int, input().split()))
wealth = list(map(int, input().split()))
wealth = sorted(wealth)
numFirstCity = int(Input[1])
numSecondCity = int(Input[2])
firstMean = 0
secondMean = 0
if numFirstCity < numSecondCity:
	for i in range(numFirstCity):
		firstMean += wealth[len(wealth) - i - 1]
	for i in range(numSecondCity):
		secondMean += wealth[len(wealth) - numFirstCity - i - 1]
else:
	for i in range(numSecondCity):
		secondMean += wealth[len(wealth) - i - 1]
	for i in range(numFirstCity):
		firstMean += wealth[len(wealth) - numSecondCity - i - 1]
print(firstMean / numFirstCity + secondMean / numSecondCity)


(n, n1, n2) = [int(i) for i in input().split()]
arr = [int(i) for i in input().split()]
arr.sort(reverse=True)
sol = sum(arr[:min(n1, n2)]) / min(n1, n2) + sum(arr[min(n1, n2):min(n1, n2) + max(n1, n2)]) / max(n1, n2)
print(sol)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 998244353

def solve():
	(N, N1, N2) = getInts()
	A = getInts()
	if N1 > N2:
		(N1, N2) = (N2, N1)
	A.sort()
	ans = sum(A[-N1:]) / N1 + sum(A[-(N1 + N2):-N1]) / N2
	return ans
print(solve())


(n, a, b) = list(map(int, input().split()))
inp = list(map(int, input().split()))
inp.sort()
if b > a:
	(a, b) = (b, a)
x = a
y = b
sum1 = 0
sum2 = 0
sum3 = 0
sum4 = 0
for i in range(n - 1, -1, -1):
	if x != 0:
		sum1 += inp[i]
		x -= 1
	else:
		sum2 += inp[i]
		y -= 1
	if y == 0:
		break
x = a
y = b
for i in range(n - 1, -1, -1):
	if y != 0:
		sum3 += inp[i]
		y -= 1
	else:
		sum4 += inp[i]
		x -= 1
	if x == 0:
		break
if (sum1 * b + sum2 * a) / (a * b) > (sum3 * a + sum4 * b) / (a * b):
	print((sum1 * b + sum2 * a) / (a * b))
else:
	print((sum3 * a + sum4 * b) / (a * b))


(n, n1, n2) = map(eval, input().split())
w = list(map(eval, input().split()))
a = min(n1, n2)
b = max(n1, n2)
w.sort(reverse=True)
suma = 0
sumb = 0
for i in range(a):
	suma += w[i]
for i in range(a, a + b):
	sumb += w[i]
ans = suma / a + sumb / b
print(ans)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
summa1 = summa2 = 0
if n1 < n2:
	for i in range(n - 1, n - n1 - 1, -1):
		summa1 += a[i]
		a.pop()
	for i in range(len(a) - 1, len(a) - n2 - 1, -1):
		summa2 += a[i]
	print(summa1 / n1 + summa2 / n2)
else:
	for i in range(n - 1, n - n2 - 1, -1):
		summa2 += a[i]
		a.pop()
	for i in range(len(a) - 1, len(a) - n1 - 1, -1):
		summa1 += a[i]
	print(summa1 / n1 + summa2 / n2)


(n, n1, n2) = tuple(map(int, input().split()))
l = list(map(int, input().split()))
l.sort(reverse=True)
m1 = 0
if n1 <= n2:
	c = 0
	s1 = 0
	while c < n1:
		s1 += l[c]
		c += 1
	c2 = 0
	i = c
	s2 = 0
	while c2 < n2:
		s2 += l[i]
		i += 1
		c2 += 1
	print('{:.8f}'.format(s1 / c + s2 / c2))
else:
	c = 0
	s1 = 0
	while c < n2:
		s1 += l[c]
		c += 1
	c2 = 0
	i = c
	s2 = 0
	while c2 < n1:
		s2 += l[i]
		i += 1
		c2 += 1
	print('{:.8f}'.format(s1 / c + s2 / c2))


from statistics import mean
inp = input().split()
n = int(inp[0])
n1 = int(inp[1])
n2 = int(inp[2])
if n1 > n2:
	(n1, n2) = (n2, n1)
a = list(map(int, input().split()))
a.sort(reverse=True)
s1 = mean(a[:n1])
s2 = mean(a[n1:n1 + n2])
print('{0:.8f}'.format(s1 + s2))


(n, n1, n2) = map(int, input().split())
people = [int(bruh) for bruh in input().split()]
people.sort()
larger = max(n1, n2)
smaller = min(n1, n2)
small = people[n - smaller:]
large = people[n - larger - smaller:n - smaller]
arithmean = sum(small) / smaller + sum(large) / larger
print(f'{arithmean:.9f}')


(n, n1, n2) = list(map(int, input().split()))
moneys = sorted(list(map(int, input().split())))
nn1 = n1
nn2 = n2
i = len(moneys) - 1
sum1 = 0
sum2 = 0
res = 0
if n1 >= n2:
	while n2 > 0:
		sum1 += moneys[i]
		n2 -= 1
		i -= 1
	res += sum1 / nn2
	while n1 > 0:
		sum2 += moneys[i]
		n1 -= 1
		i -= 1
	res += sum2 / nn1
else:
	while n1 > 0:
		sum1 += moneys[i]
		n1 -= 1
		i -= 1
	res += sum1 / nn1
	while n2 > 0:
		sum2 += moneys[i]
		n2 -= 1
		i -= 1
	res += sum2 / nn2
print(res)


(n, n1, n2) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.sort()
if n1 > n2:
	(n1, n2) = (n2, n1)
s1 = s2 = 0
for i in range(n - n1, n):
	s2 += a[i]
for i in range(n - n1 - n2, n - n1):
	s1 += a[i]
print(s1 / n2 + s2 / n1)


(n, a, b) = map(int, input().split())
(a, b) = map(int, sorted([a, b]))
x = sorted(list(map(int, input().split())))[::-1]
print(sum(x[:a]) / a + sum(x[a:a + b]) / b)


IL = lambda : list(map(int, input().split()))
IS = lambda : input().split()
I = lambda : int(input())
S = lambda : input()
(n, n1, n2) = IL()
(n1, n2) = sorted([n1, n2])
a = IL()
a = sorted(a, reverse=True)[:n1 + n2]
n = len(a)
a2 = a[-min(n2, n - 1):]
print(sum(a2) / len(a2) + (sum(a) - sum(a2)) / (len(a) - len(a2)))


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
(n, n1, n2) = invr()
if n1 > n2:
	(n1, n2) = (n2, n1)
a = inlist()
a = sorted(a, reverse=True)
res = sum(a[:n1]) / n1 + sum(a[n1:n1 + n2]) / n2
print(res)


(n, n1, n2) = input().split()
n = int(n)
n1 = int(n1)
n2 = int(n2)
arr = [int(i) for i in input().split()]
arr.sort(reverse=True)
m = min(n1, n2)
M = max(n1, n2)
(mean, total) = (0, 0)
count = 0
for i in range(m):
	total += arr[i]
	count += 1
mean += total / m
total = 0
j = 0
while j < M and count < n:
	total += arr[count]
	count += 1
	j += 1
mean += total / M
print(mean)


(n, n1, n2) = [int(item) for item in input().split()]
a = [int(item) for item in input().split()]
a = sorted(a)
(n1, n2) = (min(n1, n2), max(n1, n2))
s1 = sum(a[n - n1:]) / n1
s2 = sum(a[n - n1 - n2:n - n1]) / n2
print(s1 + s2)


(n, n1, n2) = map(int, input().split())
num = sorted(list(map(int, input().split(' '))), reverse=True)
if n1 > n2:
	(n1, n2) = (n2, n1)
print(sum(num[0:n1]) / n1 + sum(num[n1:n1 + n2]) / n2)


def main():
	(n, n1, n2) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	result = 0
	a = sorted(a)
	for x in sorted([n1, n2]):
		result += sum(a[-x:]) / x
		del a[-x:]
	print(result)
main()


fmap = lambda f, l: list(map(f, l))
parse_int = lambda : fmap(int, input().split())
DEBUG = False
(n, n1, n2) = parse_int()
ppl = list(sorted(parse_int()))
if n1 < n2:
	(n1, n2) = (n2, n1)
(sity1, sity2) = (0, 0)
pos = len(ppl) - 1
for _ in range(n2):
	sity2 += ppl[pos]
	pos -= 1
for _ in range(n1):
	sity1 += ppl[pos]
	pos -= 1
print(sity1 / n1 + sity2 / n2)


(n, n1, n2) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort(reverse=True)
if sum(arr[0:n1]) * n2 + sum(arr[n1:n1 + n2]) * n1 > sum(arr[0:n2]) * n1 + sum(arr[n2:n1 + n2]) * n2:
	print((sum(arr[0:n1]) * n2 + sum(arr[n1:n1 + n2]) * n1) / (n1 * n2))
else:
	print((sum(arr[0:n2]) * n1 + sum(arr[n2:n1 + n2]) * n2) / (n1 * n2))


(n, a, b) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort(reverse=True)
if a < b:
	(a, b) = (b, a)
ans = sum(arr[0:b]) / b
ans += sum(arr[b:b + a]) / a
print(ans)


(n, n1, n2) = list(map(int, input().split()))
line = list(map(int, input().split()))
line.sort(reverse=True)
mi = min(n1, n2)
ma = max(n1, n2)
i = 0
minSum = 0
maxSum = 0
for x in range(mi):
	minSum = minSum + line[i]
	i = i + 1
for x in range(ma):
	maxSum = maxSum + line[i]
	i = i + 1
print(minSum / mi + maxSum / ma)


def solve():
	(n, n1, n2) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	(sum1, sum2, sum3, sum4) = (0, 0, 0, 0)
	for i in range(0, n1):
		sum1 += l[i]
	for i in range(0, n2):
		sum3 += l[i]
	for i in range(n1, n1 + n2):
		sum2 += l[i]
	for i in range(n2, n2 + n1):
		sum4 += l[i]
	if sum1 / n1 + sum2 / n2 <= sum3 / n2 + sum4 / n1:
		print('%.8f' % (sum3 / n2 + sum4 / n1))
	else:
		print('%8f' % (sum1 / n1 + sum2 / n2))
solve()


(n, n1, n2) = list(map(int, input().split()))
a = sorted(list(map(int, input().split())), reverse=True)
s1 = sum(a[:min(n1, n2)]) / min(n1, n2)
s2 = sum(a[min(n1, n2):n1 + n2]) / max(n1, n2)
print(s1 + s2)


(n1, n2, n) = list(sorted(map(int, input().split())))
we = list(sorted(map(int, input().split())))[-(n1 + n2):]
av1 = sum(we[:n2]) / n2
av2 = sum(we[n2:]) / n1
print('{0:.9f}'.format(av1 + av2))


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
(n1, n2) = (min(n1, n2), max(n1, n2))
a = sorted(a)[::-1]
print(sum(a[:n1]) / n1 + sum(a[n1:n1 + n2]) / n2)


from sys import stdin
(n, premier, second) = map(int, input().split())
candidats = list(map(int, stdin.readline().split()))
candidats.sort(reverse=True)
if premier > second:
	(premier, second) = (second, premier)
ville1 = 0
ville2 = 0
for i in range(premier):
	ville1 += candidats[i]
for j in range(premier, second + premier):
	ville2 += candidats[j]
print(ville1 / premier + ville2 / second)


(a, a1, a2) = map(int, input().split())
pol = [float(x) for x in input().split()]
pol.sort()
tempp = pol[a - (a1 + a2):]
if a1 < a2:
	res1 = sum(tempp[-a1:]) / a1
	res2 = sum(tempp[0:-a1]) / a2
	print(res1 + res2)
else:
	res1 = sum(tempp[-a2:]) / a2
	res2 = sum(tempp[0:-a2]) / a1
	print(res1 + res2)


(n, n1, n2) = map(int, input().split())
L = list(map(int, input().split()))
L.sort(reverse=True)
L1 = L[:n1]
L2 = L[n1:n1 + n2]
L3 = L[:n2]
L4 = L[n2:n1 + n2]
r1 = sum(L1) / n1 + sum(L2) / n2
r2 = sum(L3) / n2 + sum(L4) / n1
print(max(r1, r2))


get = lambda : list(map(int, input().split()))
(n, N1, N2) = get()
l = get()
l.sort(reverse=True)
if N1 < N2:
	c1 = l[:N1]
	c2 = l[N1:N2 + N1]
	ans = sum(c1) / N1 + sum(c2) / N2
else:
	c2 = l[:N2]
	c1 = l[N2:N2 + N1]
	ans = sum(c1) / N1 + sum(c2) / N2
print('%.10f' % ans)


(n, n1, n2) = map(int, input().split())
A = input().split()
A = [int(x) for x in A]
A.sort(reverse=True)
(S1, S2) = (0, 0)
if n1 > n2:
	for i in range(n):
		if i < n2:
			S2 += A[i]
		if n2 <= i < n1 + n2:
			S1 += A[i]
	print(S1 / n1 + S2 / n2)
else:
	for i in range(n):
		if i < n1:
			S1 += A[i]
		if n1 <= i < n1 + n2:
			S2 += A[i]
	print(S1 / n1 + S2 / n2)


(n, n1, n2) = [int(x) for x in input().split()]
p = sorted([int(x) for x in input().split()], reverse=True)
(tn1, tn2) = (n1, n2)
(ln1, ln2) = ([], [])
if n1 <= n2:
	while tn1 != 0:
		ln1.append(p[0])
		del p[0]
		tn1 -= 1
else:
	while tn2 != 0:
		ln2.append(p[0])
		del p[0]
		tn2 -= 1
while tn1 != 0:
	ln1.append(p[0])
	del p[0]
	tn1 -= 1
while tn2 != 0:
	ln2.append(p[0])
	del p[0]
	tn2 -= 1
print(sum(ln1) / n1 + sum(ln2) / n2)


(n, n1, n2) = map(int, input().split())
a = list(sorted(map(int, input().split())))
if n1 < n2:
	(n1, n2) = (n2, n1)
print(sum([i for i in a[n - n1 - n2:n - n2]]) / n1 + sum([i for i in a[n - n2:]]) / n2)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
maxm = max(n1, n2)
minm = min(n1, n2)
print(sum(a[:minm]) / minm + sum(a[minm:n1 + n2]) / maxm)


(n, n1, n2) = map(int, input().split())
vals = list(sorted(list(map(int, input().split())), reverse=True))
if n2 > n1:
	print(sum(vals[:n1]) / n1 + sum(vals[n1:n1 + n2]) / n2)
else:
	print(sum(vals[:n2]) / n2 + sum(vals[n2:n2 + n1]) / n1)


(n, n1, n2) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a.sort(reverse=True)
smallcity = min(n1, n2)
largecity = max(n1, n2)
answer = 0
smallsum = 0
for i in range(0, smallcity):
	smallsum += a[i]
answer += smallsum / smallcity
largesum = 0
for i in range(smallcity, smallcity + largecity):
	largesum += a[i]
answer += largesum / largecity
print(answer)


i = lambda : map(int, input().split())
(n, x, y) = i()
a = sorted(i())[::-1]
if x > y:
	(x, y) = (y, x)
print(sum(a[:x]) / x + sum(a[x:][:y]) / y)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
if n1 == 1 or n2 == 1:
	x = max(a)
	a.pop(a.index(x))
	ans = x
	a.sort()
	a.reverse()
	ans += sum(a[:max(n1, n2)]) / max(n1, n2)
	print(ans)
else:
	a.sort()
	a.reverse()
	x = min(n1, n2)
	ans = sum(a[:x]) / x
	ans += sum(a[x:x + max(n1, n2)]) / max(n1, n2)
	print(ans)


(n, n1, n2) = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
(n1, n2) = (max(n1, n2), min(n1, n2))
s1 = 0
s2 = 0
for i in range(n2):
	s1 += l[i]
for i in range(n2, n1 + n2):
	s2 += l[i]
print(s1 / n2 + s2 / n1)


(n, n1, n2) = map(int, input().split())
a = sorted(list(map(int, input().split())))
ans = 0.0
s = 0.0
for i in range(min(n1, n2)):
	s += a[n - 1 - i]
s /= min(n1, n2)
ans += s
s = 0.0
for i in range(min(n1, n2), min(n1, n2) + max(n1, n2)):
	s += a[n - 1 - i]
s /= max(n1, n2)
ans += s
print(ans)


def main():
	(n, n1, n2) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	a = a[:n1 + n2]
	ans = 0
	if n2 > n1:
		ans = sum(a[:n1]) / n1 + sum(a[n1:]) / n2
	else:
		ans = sum(a[:n2]) / n2 + sum(a[n2:]) / n1
	print(ans)
main()


(n, n1, n2) = input().split()
avg = 0
(n, n1, n2) = [int(n), int(n1), int(n2)]
a = [int(x) for x in input().split()]
a.sort()
a.reverse()
if n1 >= n2:
	avg = sum(a[:n2]) / len(a[:n2]) + sum(a[n2:n1 + n2]) / len(a[n2:n1 + n2])
elif n2 > n1:
	avg = sum(a[:n1]) / len(a[:n1]) + sum(a[n1:n1 + n2]) / len(a[n1:n1 + n2])
print(format(avg, '.8f'))


(n, n1, n2) = list(map(int, input().split()))
l = list(map(int, input().split()))
l.sort(reverse=True)
(n1, n2) = sorted([n1, n2])
print(sum(l[:n1]) / n1 + sum(l[n1:n1 + n2]) / n2)


(n, n1, n2) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort(reverse=True)
(k1, k2) = (min(n1, n2), max(n1, n2))
ans = sum(arr[0:k1]) / k1 + sum(arr[k1:k1 + k2]) / k2
print(ans)


(n, n1, n2) = map(int, input().split())
g = list(map(int, input().split()))
l = sorted(g)
k = len(l)
a = 0
b = 0
if n1 >= n2:
	for i in range(k - n2, k):
		a = a + l[i]
	a = a / n2
	for j in range(k - n2 - n1, k - n2):
		b = b + l[j]
	b = b / n1
	print(a + b)
else:
	for i in range(k - n1, k):
		a = a + l[i]
	a = a / n1
	for j in range(k - n2 - n1, k - n1):
		b = b + l[j]
	b = b / n2
	print(a + b)


line1 = [int(x) for x in input().split(' ')]
n = line1[0]
n1 = line1[1]
n2 = line1[2]
citizens = []
city1 = []
city2 = []
line2 = [int(x) for x in input().split(' ')]
for i in range(n):
	citizens.append(line2[i])
citizens.sort(reverse=True)
if n1 >= n2:
	for i in range(n2):
		city2.append(citizens[0])
		citizens.pop(0)
	for j in range(n1):
		city1.append(citizens[0])
		citizens.pop(0)
else:
	for i in range(n1):
		city1.append(citizens[0])
		citizens.pop(0)
	for j in range(n2):
		city2.append(citizens[0])
		citizens.pop(0)
av_sum = float(sum(city1) / n1 + sum(city2) / n2)
print(av_sum)


(n, n1, n2) = map(int, input().split())
a = sorted(list(map(int, input().split())))
if n1 > n2:
	tmp = n1
	n1 = n2
	n2 = tmp
s1 = 0
tmp = n1
while tmp > 0:
	tmp -= 1
	s1 += a.pop()
s2 = 0
tmp = n2
while tmp > 0:
	tmp -= 1
	s2 += a.pop()
print(s1 / (n1 + 0.0) + s2 / (n2 + 0.0))


(n, a, b) = map(int, input().split())
l = sorted(list(map(int, input().split())), reverse=True)
if a > b:
	ans = sum(l[:b]) / b + sum(l[b:a + b]) / a
	print('{A:.8f}'.format(A=ans))
else:
	ans = sum(l[:a]) / a + sum(l[a:a + b]) / b
	print('{A:.8f}'.format(A=ans))


a = list(map(int, input().split()))
n = max(a)
a.pop(0)
x = max(a)
y = min(a)
array = list(map(int, input().split()))
array.sort(reverse=True)
t = array[:y]
r = array[y:x + y]
t = sum(t)
r = sum(r)
t = t / y
r = r / x
print(t + r)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
if n1 > n2:
	x = sum(a[:n2]) / n2
	y = sum(a[n2:n2 + n1]) / n1
	print(x + y)
else:
	x = sum(a[:n1]) / n1
	y = sum(a[n1:n2 + n1]) / n2
	print(x + y)


(n, a, b) = map(int, input().split())
l = list(map(int, input().split()))
if a > b:
	c = a
	a = b
	b = c
l = sorted(l)
p = 0
p1 = 0
v = 0
v1 = 0
for i in range(n - 1, -1, -1):
	if a != 0:
		p = p + l[i]
		v = v + 1
		a = a - 1
	elif b != 0:
		p1 = p1 + l[i]
		v1 = v1 + 1
		b = b - 1
	else:
		break
print(p / v + p1 / v1)


(n, n1, n2) = map(int, input().split())
l = list(map(int, input().split()))
(a, b) = (0, 0)
(x, y) = (min(n1, n2), max(n1, n2))
l.sort()
l.reverse()
for i in range(n):
	if x > 0:
		a += l[i]
		x -= 1
	elif y > 0:
		b += l[i]
		y -= 1
print(a / min(n1, n2) + b / max(n1, n2))


from math import *
from sys import *
from queue import *
from decimal import *
(n, n1, n2) = (int(z) for z in input().split())
s = [int(z) for z in input().split()]
s.sort()
for i in range(n // 2):
	(s[i], s[n - 1 - i]) = (s[n - 1 - i], s[i])
sum1 = 0
sum2 = 0
if n1 > n2:
	(n1, n2) = (n2, n1)
for i in range(n1):
	sum1 += s[i]
for i in range(n1, n1 + n2):
	sum2 += s[i]
print(Decimal(sum1) / Decimal(n1) + Decimal(sum2) / Decimal(n2))


(n, n1, n2) = map(int, input().split())
xs = [int(x) for x in input().split()]
xs.sort()
minn = min(n1, n2)
maxn = max(n1, n2)
mean1 = 0
for i in range(minn):
	mean1 += xs[len(xs) - i - 1]
mean1 /= minn
mean2 = 0
for i in range(maxn):
	mean2 += xs[len(xs) - i - 1 - minn]
mean2 /= maxn
print(mean1 + mean2)


(n, n1, n2) = map(int, input().split())
a = [int(x) for x in input().split()]
a.sort()
a.reverse()
(n1, n2) = (min(n1, n2), max(n1, n2))
ans1 = sum(a[0:n1])
ans2 = sum(a[n1:n1 + n2])
print(ans1 / n1 + ans2 / n2)


(n, n1, n2) = map(int, input().split(' '))
a = str(input()).split(' ')
a = list(map(int, a))
a.sort()
a = a[::-1]
if n1 < n2:
	s1 = sum(a[:n1]) / float(n1)
	s2 = sum(a[n1:n1 + n2]) / float(n2)
else:
	s1 = sum(a[:n2]) / float(n2)
	s2 = sum(a[n2:n1 + n2]) / float(n1)
print(s1 + s2)


(a, b, c) = [int(i) for i in input().strip().split(' ')]
l = [int(i) for i in input().strip().split(' ')]
l.sort()
sum1 = 0
for i in range(min(c, b)):
	sum1 += l.pop()
sum1 /= min(c, b)
sum2 = 0
for i in range(max(c, b)):
	sum2 += l.pop()
sum2 /= max(c, b)
print(sum1 + sum2)


(n, n1, n2) = [int(i) for i in input().split()]
if n1 > n2:
	(n1, n2) = (n2, n1)
lista = [int(i) for i in input().split()]
lista.sort(reverse=True)
sn1 = sn2 = 0
for i in range(n1):
	sn1 += lista[i]
for i in range(n1, n1 + n2):
	sn2 += lista[i]
print('%.6f' % (sn1 / n1 + sn2 / n2))


(n, n1, n2) = map(int, input().split())
x = sorted(list(map(int, input().split())))[::-1]
a = sum(x[:n1]) / n1 + sum(x[n1:n1 + n2]) / n2
b = sum(x[:n2]) / n2 + sum(x[n2:n2 + n1]) / n1
print(max(a, b))


def inp(n):
	if n == 1:
		return map(int, stdin.readline().split())
	elif n == 2:
		return map(float, stdin.readline().split())
	else:
		return map(str, stdin.readline().split())

def arr_inp():
	return [int(x) for x in stdin.readline().split()]
from sys import *
(n, n1, n2) = inp(1)
(mi, ma) = (min(n1, n2), max(n1, n2))
a = sorted(arr_inp(), reverse=True)
print('{:.8f}'.format(sum(a[:mi]) / mi + sum(a[mi:ma + mi]) / ma))


(n, n1, n2) = [int(x) for x in input().split()]
d = [int(x) for x in input().split()]
d.sort(reverse=True)
s1 = 0
s2 = 0
(n1, n2) = (min(n1, n2), max(n1, n2))
for i in range(n1):
	s1 += d[i]
for i in range(n1, n1 + n2):
	s2 += d[i]
ans = s1 / n1 + s2 / n2
print(ans)


(n, n1, n2) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.sort()
n = min(n1, n2)
x = max(n1, n2)
print((sum(a[-n:]) * x + sum(a[-n - x:-n]) * n) / x / n)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
k = max(n1, n2)
p = min(n1, n2)
a.reverse()
o = 0
q = 0
for i in range(p):
	o += a[i]
for i in range(p, p + k):
	q += a[i]
print('{0:.10f}'.format(o / p + q / k))


import sys
import math
import collections
import heapq
import decimal
input = sys.stdin.readline
(n, n1, n2) = (int(i) for i in input().split())
l = sorted([int(i) for i in input().split()])
m1 = sum(l[n - min(n1, n2):]) / min(n1, n2)
m2 = sum(l[n - n1 - n2:n - min(n1, n2)]) / max(n1, n2)
print(m1 + m2)


(_, n1, n2) = map(int, input().split())
wealths = sorted(map(int, input().split()))[::-1]
res = 0
res += sum(wealths[:min(n1, n2)]) / min(n1, n2) + sum(wealths[min(n1, n2):max(n1, n2) + min(n1, n2)]) / max(n1, n2)
print(res)


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
from fractions import Fraction

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)
(n, n1, n2) = mi()
(a, b) = (n1, n2)
l = sorted(li())[::-1]
(s1, s2) = (0, 0)
if n1 > n2:
	for i in range(n1 + n2):
		if n2 > 0:
			n2 -= 1
			s2 += l[i]
		else:
			n1 -= 1
			s1 += l[i]
else:
	for i in range(n1 + n2):
		if n1 > 0:
			n1 -= 1
			s1 += l[i]
		else:
			n2 -= 1
			s2 += l[i]
x = s1 / a
y = s2 / b
print(x + y)


(n, n1, n2) = map(int, input().split())
a = sorted(map(float, input().split()), reverse=True)
ans = 0
if n1 > n2:
	ans = (sum(a[:n2]) * n1 + sum(a[n2:n1 + n2]) * n2) / (n1 * n2)
else:
	ans = (sum(a[:n1]) * n2 + sum(a[n1:n1 + n2]) * n1) / (n1 * n2)
print('{:0.8f}'.format(ans))


(n, n1, n2) = [int(x) for x in input().split()]
(n1, n2) = (max(n1, n2), min(n1, n2))
a = sorted([int(x) for x in input().split()])[n - (n1 + n2):]
print(sum(a[0:n1]) / n1 + sum(a[n1:]) / n2)


(n, a, b) = [int(i) for i in input().split()]
wealth = [int(i) for i in input().split()]
wealth.sort(reverse=True)
if a > b:
	(a, b) = (b, a)
print(sum(wealth[:a]) / a + sum(wealth[a:a + b]) / b)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
if n1 > n2:
	(n1, n2) = (n2, n1)
s1 = sum(a[:n1]) / n1
s2 = sum(a[n1:n2 + n1]) / n2
print(s1 + s2)


import sys
from collections import defaultdict
(n, n1, n2) = [int(x) for x in sys.stdin.readline().split()]
a = [int(x) for x in sys.stdin.readline().split()]
a = sorted(a)
if n1 > n2:
	tmp = n1
	n1 = n2
	n2 = tmp
nn1 = n1
nn2 = n2
s1 = 0
s2 = 0
i = n - 1
while n1 > 0:
	s1 += a[i]
	n1 -= 1
	i -= 1
while n2 > 0:
	s2 += a[i]
	n2 -= 1
	i -= 1
print(s1 / nn1 + s2 / nn2)


inp = [int(s) for s in input().split()]
people = [int(s) for s in input().split()]
people.sort()
s = len(people)
sum1 = 0
sum2 = 0
if inp[1] < inp[2]:
	for i in range(inp[1]):
		sum1 += people[s - i - 1]
	for i in range(inp[2]):
		sum2 += people[s - 1 - inp[1] - i]
	print(sum1 / inp[1] + sum2 / inp[2])
else:
	for i in range(inp[2]):
		sum1 += people[s - 1 - i]
	for i in range(inp[1]):
		sum2 += people[s - 1 - inp[2] - i]
	print(sum1 / inp[2] + sum2 / inp[1])


(n, u, v) = map(int, input().split())
if u > v:
	(u, v) = (v, u)
a = sorted(map(int, input().split()))[::-1]
print(sum(a[:u]) / u + sum(a[u:u + v]) / v)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a = a[n - (n1 + n2):]
ans = 0
if n1 > n2:
	ans += sum(a[-n2:]) / n2
	ans += sum(a[:-n2]) / n1
else:
	ans += sum(a[-n1:]) / n1
	ans += sum(a[:-n1]) / n2
print('%.7f' % ans)


(n, n1, n2) = map(int, input().split())
a = [int(i) for i in input().split()]
a.sort(reverse=True)
if n1 > n2:
	(n1, n2) = (n2, n1)
s1 = sum(a[:n1])
s2 = sum(a[n1:n2 + n1])
print(s1 / n1 + s2 / n2)


import sys
(n, n1, n2) = map(int, input().split())
alist = list(map(int, input().split()))
alist.sort(reverse=True)
sum1 = sum2 = 0
if n1 < n2:
	for i in range(0, n1):
		sum1 += alist[i]
	for j in range(n1, n1 + n2):
		sum2 += alist[j]
	print(sum1 / n1 + sum2 / n2)
else:
	for i in range(0, n2):
		sum1 += alist[i]
	for j in range(n2, n2 + n1):
		sum2 += alist[j]
	print(sum1 / n2 + sum2 / n1)


from sys import stdin, stdout
(n, n1, n2) = map(int, stdin.readline().split())
numbers = sorted(list(map(int, stdin.readline().split())))[::-1][:n1 + n2][::-1]
ans = 0
if n1 > n2:
	ans += sum(numbers[:n1]) / n1 + sum(numbers[::-1][:n2]) / n2
else:
	ans += sum(numbers[:n2]) / n2 + sum(numbers[::-1][:n1]) / n1
stdout.write(str(ans))


l = input().split()
l = list(map(int, l))
n = l[0]
n1 = min(l[1], l[2])
n2 = max(l[1], l[2])
arr = input().split()
arr = list(map(int, arr))
arr.sort()
arr.reverse()
s = 0
i = 0
while i != n1:
	s = s + arr[i]
	i = i + 1
ans = s / n1
s = 0
while i != n1 + n2:
	s = s + arr[i]
	i = i + 1
ans = ans + s / n2
print(ans)


(n, n1, n2) = map(int, input().split())
v = list(map(int, input().split()))
v.sort()
v = v[::-1]
(n1, n2) = (min(n1, n2), max(n1, n2))
print((sum(v[0:n1]) * n2 + sum(v[n1:n1 + n2]) * n1) / (n1 * n2))


(n, nn, nnn) = map(int, input().split())
a = sorted([int(x) for x in input().split()], reverse=True)
if nn > nnn:
	(nn, nnn) = (nnn, nn)
f = []
s = []
for i in range(n):
	if nn > 0:
		f.append(a[i])
		nn -= 1
	elif nnn > 0:
		s.append(a[i])
		nnn -= 1
	else:
		break
print('{0:.8f}'.format(sum(f) / len(f) + sum(s) / len(s)))


read = lambda : map(int, input().split())
(n, n1, n2) = read()
a = sorted(read())[::-1]
if n1 > n2:
	(n1, n2) = (n2, n1)
ans = sum(a[:n1]) / n1 + sum(a[n1:n1 + n2]) / n2
print(ans)


ni = list(map(int, input().split()))[:3]
s = list(map(int, input().split()))[:ni[0]]
n = ni[0]
if ni[1] < ni[2]:
	n1 = ni[1]
	n2 = ni[2]
else:
	n1 = ni[2]
	n2 = ni[1]
s.sort(reverse=True)
sum1 = 0
sum2 = 0
for i in range(n1):
	sum1 = sum1 + s[i]
for i in range(n2):
	sum2 = sum2 + s[i + n1]
sum = float(sum1 / n1 + sum2 / n2)
print(sum)


num = input().split()
n = int(num[0])
n1 = int(num[1])
n2 = int(num[2])
num = input().split()
arr = []
for i in range(n):
	arr.append(int(num[i]))
(n1, n2) = (min(n1, n2), max(n1, n2))
arr.sort(reverse=True)
ans = sum(arr[:n1]) / n1 + sum(arr[n1:n1 + n2]) / n2
print(ans)


(n, n1, n2) = (int(x) for x in input().split())
a = list((int(x) for x in input().split()))
a = sorted(a, reverse=True)
if n1 < n2:
	s = 0
	for i in range(n1):
		s += a[i]
	d = 0
	for j in range(n1, n1 + n2):
		d += a[j]
	s /= n1
	d /= n2
else:
	s = 0
	for i in range(n2):
		s += a[i]
	d = 0
	for j in range(n2, n1 + n2):
		d += a[j]
	s /= n2
	d /= n1
print(s + d)


(n, n1, n2) = map(int, input().split())
a = sorted(list(map(int, input().split())))[n - (n1 + n2):]
avg1 = sum(a[max(n1, n2):]) / min(n1, n2)
avg2 = sum(a[:max(n1, n2)]) / max(n1, n2)
print(avg1 + avg2)


(n, n1, n2) = map(int, input().split())
a = list(map(float, input().split()))
a.sort(reverse=True)
k = max(n1, n2)
m = min(n1, n2)
print(sum(a[:m]) / m + sum(a[m:m + k]) / k)


I = lambda : map(int, input().split())
(_, n1, n2) = I()
A = sorted(I(), reverse=True)
if n1 > n2:
	(n1, n2) = (n2, n1)
print(sum(A[:n1]) / n1 + sum(A[n1:n1 + n2]) / n2)


(a, b, c) = map(int, input().split(' '))
l = list(map(int, input().split(' ')))
l.sort(reverse=True)
if c > b:
	total = sum(l[0:b]) / b + sum(l[b:b + c]) / c
else:
	total = sum(l[0:c]) / c + sum(l[c:c + b]) / b
print(total)


(n, n1, n2) = map(int, input().split())
at = [int(z) for z in input().split()]
a = sorted(at, reverse=True)
if n1 >= n2:
	s = sum(a[0:n2]) / n2 + sum(a[n2:n2 + n1]) / n1
else:
	s = sum(a[0:n1]) / n1 + sum(a[n1:n2 + n1]) / n2
print(s)


l1 = list(map(int, input().split()))
(n, n1, n2) = (l1[0], l1[1], l1[2])
l = list(map(int, input().split()))
l = list(reversed(sorted(l)))
s = 0
k = n1
Srmax1 = -1
Srmax2 = -1
t = n2
for i in range(n1):
	s = s + l[i]
	Sr = s / (i + 1)
	Srmax1 = Sr
Sr = 0
s = 0
for i in range(n2):
	s = s + l[i]
	Sr = s / (i + 1)
if Srmax1 < Sr:
	Srmax1 = Sr
	t = n1
	k = n2
l = l[k:]
s = 0
Sr = 0
s = 0
for i in range(t):
	s = s + l[i]
	Sr = s / (i + 1)
	Srmax2 = Sr
print(Srmax1 + Srmax2)


def main():
	try:
		while True:
			(n, n1, n2) = map(int, input().split())
			a = sorted(map(int, input().split()), reverse=True)
			print('%.6f' % max(sum(a[:n1]) / n1 + sum(a[n1:n1 + n2]) / n2, sum(a[:n2]) / n2 + sum(a[n2:n2 + n1]) / n1))
	except EOFError:
		pass
main()


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
(n, n1, n2) = MAP()
arr = LIST()
arr.sort(reverse=True)
l1 = []
l2 = []
if n1 > n2:
	(n1, n2) = (n2, n1)
for i in range(n):
	if len(l1) < n1:
		l1.append(arr[i])
	elif len(l2) < n2:
		l2.append(arr[i])
	else:
		break
res = sum(l1) / n1 + sum(l2) / n2
print(res)


(n, n1, n2) = map(int, input().split())
l = sorted(map(int, input().split()))[::-1]
ans = 0
if n1 < n2:
	(n1, n2) = (n2, n1)
ans += sum(l[:n2]) / n2
ans += sum(l[n2:n2 + n1]) / n1
print(ans)


(n, n1, n2) = map(int, input().split())
s = list(map(int, input().split()))
s.sort()
s.reverse()
n0 = min(n1, n2)
nm = max(n1, n2)
i = 0
a = 0
while i < n0:
	a = a + s[i]
	i += 1
b = 0
while i < n1 + n2:
	b = b + s[i]
	i += 1
print(float(a / n0 + b / nm))


(n, a, b) = [int(x) for x in input().split()]
s = [0] * n
s = [int(x) for x in input().split()]
s.sort()
if a > b:
	c = b
	b = a
	a = c
i = n - 1
j = 0
su = 0
while j < a:
	su = su + s[i]
	i = i - 1
	j += 1
sum = 0
j = 0
while j < b:
	sum = sum + s[i]
	i = i - 1
	j += 1
print(su / a + sum / b)


(n, n1, n2) = map(int, input().split())
A = list(map(int, input().split()))
if n1 > n2:
	(n2, n1) = (n1, n2)
A.sort()
sums1 = 0
sums2 = 0
for j in range(n - 1, n - 1 - n1, -1):
	sums1 += A[j]
for j in range(n - 1 - n1, n - 1 - n1 - n2, -1):
	sums2 += A[j]
print(sums1 / n1 + sums2 / n2)


(n, n1, n2) = map(int, input().split())
t = input().split()
t = [int(x) for x in t]
t.sort(reverse=True)
sum1 = 0
sum2 = 0
if n1 > n2:
	for i in range(n):
		if i < n2:
			sum2 += t[i]
		if n2 <= i < n1 + n2:
			sum1 += t[i]
	ans = sum1 / n1 + sum2 / n2
	print(ans)
else:
	for i in range(n):
		if i < n1:
			sum1 += t[i]
		if n1 <= i < n1 + n2:
			sum2 += t[i]
	ans = sum1 / n1 + sum2 / n2
	print(ans)


(n, n1, n2) = tuple(map(int, input().split()))
A = map(int, input().split())

def urb(n, n1, n2, A):
	if n1 > n2:
		(n2, n1) = (n1, n2)
	A = list(reversed(sorted(A)))
	A1 = A[:n1]
	A2 = A[n1:n1 + n2]
	return sum(A1) / n1 + sum(A2) / n2
print(format(urb(n, n1, n2, A), '.10f'))


import sys
from os import path
if path.exists('input.txt') and path.exists('output.txt'):
	sys.stdout = open('output.txt', 'w')
	sys.stdin = open('input.txt', 'r')

def main():
	(n, n1, n2) = (int(i) for i in input().split())
	l = sorted([int(i) for i in input().split()], reverse=True)
	if n1 > n2:
		(n1, n2) = (n2, n1)
	ans = sum(l[:n1]) / n1 + sum(l[n1:n1 + n2]) / n2
	print(ans)
main()


(n, n1, n2) = list(map(int, input().split()))
ns = list(map(int, input().split()))
ns = sorted(ns)
(t1, t2) = (0, 0)
if n2 > n1:
	(n1, n2) = (n2, n1)
for i in ns[n - n1 - n2:n - n2]:
	t1 += i
for i in ns[n - n2:]:
	t2 += i
print(t1 / n1 + t2 / n2)


l1 = list(map(int, input().split()))
cities = l1[1:]
cities.sort()
wealth = list(map(int, input().split()))
wealth.sort(reverse=True)
sum = ts = 0
used = []
start = end = 0
for cd in range(len(cities)):
	if cd == 0:
		start = 0
		end = cities[0]
	else:
		start = cities[cd - 1]
		end = start + cities[cd]
	ts = 0
	nl = wealth[start:end]
	for i in range(len(nl)):
		ts += nl[i]
		if i == len(nl) - 1:
			sum += ts / cities[cd]
			break
print(sum)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
if n1 > n2:
	(n1, n2) = (n2, n1)
a = sorted(a)[::-1]
print(sum(a[0:n1]) / n1 + sum(a[n1:n1 + n2]) / n2)


[n, n1, n2] = [int(i) for i in input().split()]
[n1, n2] = [max([n1, n2]), min([n1, n2])]
we = [int(i) for i in input().split()]
we.sort(reverse=True)
print(sum(we[0:n2]) / n2 + sum(we[n2:n1 + n2]) / n1)


(N, N1, N2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
if N1 > N2:
	tmp = N1
	N1 = N2
	N2 = tmp
print(sum(a[:N1]) / N1 + sum(a[N1:N1 + N2]) / N2)


(n, n1, n2) = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
arr.sort(reverse=True)
smaller = min(n1, n2)
larger = max(n1, n2)
arr = arr[:smaller + larger]
print(sum(arr[:smaller]) / smaller + sum(arr[smaller:]) / larger)


(n, n1, n2) = map(int, input().split())
a = [int(c) for c in input().split(' ')]
a.sort(reverse=True)
if n1 > n2:
	(n1, n2) = (n2, n1)
temp = 0
res = 0
for i in range(0, n1):
	temp += a[i]
res += temp / n1
temp = 0
for i in range(n1, n1 + n2):
	temp += a[i]
res += temp / n2
print('{0:.6f}'.format(res))


(n, a, b) = map(int, input().split(' '))
l = list(map(int, input().split(' ')))
l.sort()
print(max(sum(l[-a:]) / a + sum(l[-a - b:-a]) / b, sum(l[-b:]) / b + sum(l[-a - b:-b]) / a))


(n, n1, n2) = map(int, input().split())
ppl = list(map(int, input().split()))
ppl.sort()
ppl = ppl[n - (n1 + n2):]

def sum1(l):
	zbroj = 0
	for e in l:
		zbroj += e
	return zbroj
a1 = 0
a2 = 0
if n1 > n2:
	a1 += sum1(ppl[n1:]) / n2
	a2 += sum1(ppl[:n1]) / n1
else:
	a1 += sum1(ppl[n2:]) / n1
	a2 += sum1(ppl[:n2]) / n2
print(a1 + a2)


(n, n1, n2) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a.sort()
(n1, n2) = (min(n1, n2), max(n1, n2))
to_consider = a[-n1 - n2:]
(pa, pb) = (to_consider[:n2], to_consider[n2:])
print(float(sum(pa)) / len(pa) + float(sum(pb)) / len(pb))


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
b = []
c = []
if n1 < n2:
	for i in range(n1):
		b.append(a.pop(0))
	for i in range(n2):
		c.append(a.pop(0))
else:
	for i in range(n2):
		c.append(a.pop(0))
	for i in range(n1):
		b.append(a.pop(0))
x = sum(b) / n1 + sum(c) / n2
print('%.8f' % x)


def main():
	from sys import stdin, stdout
	import collections
	(n, n1, n2) = map(int, stdin.readline().split())
	a = sorted(map(int, stdin.readline().split()), reverse=True)
	minim = min(n1, n2)
	maxim = max(n1, n2)
	ans = sum(a[:minim]) / minim
	ans += sum(a[minim:minim + maxim]) / maxim
	stdout.write('{:.6f}'.format(ans))
main()


(n, n1, n2) = map(int, input().split())
l = [int(j) for j in input().split()]
l.sort(reverse=True)
(n1, n2) = (min(n1, n2), max(n1, n2))
t = sum(l[:n1]) / n1
t2 = sum(l[n1:n1 + n2]) / n2
print(t + t2)


from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from heapq import heappush, heappop
import math
import io
import os
import math
import bisect

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def digits(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def ceil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def mapin():
	return map(int, input().split())
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(n, n1, n2) = mapin()
a = [float(x) for x in input().split()]
a.sort(reverse=True)
ans = 0
if n2 > n1:
	(n1, n2) = (n2, n1)
for i in range(n2):
	ans += a[i] / float(n2)
for i in range(n1):
	ans += a[i + n2] / float(n1)
print(ans)


(n, n1, n2) = map(int, input().split())
nn = [n1, n2]
nn = sorted(nn)
a = list(map(int, input().split()))
a = list(reversed(sorted(a)))
print((nn[1] * sum(a[:nn[0]]) + nn[0] * sum(a[nn[0]:nn[0] + nn[1]])) / (nn[0] * nn[1]))


(a, b, c) = map(int, input().split())
l = sorted(list(map(int, input().split())))[-b - c:]
print(sum(l[:max(b, c)]) / max(b, c) + sum(l[max(b, c):]) / min(b, c))


(n, n1, n2) = map(int, input().split())
if n1 > n2:
	(n1, n2) = (n2, n1)
sum_n1 = sum_n2 = 0
wealth = list(map(int, input().strip().split()))
wealth.sort(reverse=True)
for i in range(0, n1):
	sum_n1 += wealth[i]
for j in range(0, n2):
	sum_n2 += wealth[n1 + j]
arith_sum = sum_n1 / n1 + sum_n2 / n2
print(arith_sum)


(n, a, b) = [int(i) for i in input().split()]
w = list(map(int, input().split()))
if a > b:
	(a, b) = (b, a)
w.sort(reverse=True)
s1 = 0
s2 = 0
for i in range(n):
	if i < a:
		s1 = s1 + w[i]
	elif i < a + b:
		s2 = s2 + w[i]
print(s1 / a + s2 / b)


(n, n1, n2) = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=1)
if n1 < n2:
	c1 = a[:n1]
	c2 = a[n1:n1 + n2]
else:
	c2 = a[:n2]
	c1 = a[n2:n2 + n1]
print('{0:.8f}'.format(sum(c1) / n1 + sum(c2) / n2))


(n, n1, n2) = list(map(int, input().split(' ')))
l = sorted(list(map(int, input().split(' '))), reverse=1)
l1 = []
l2 = []
if n2 < n1:
	(n1, n2) = (n2, n1)
curr = 1
l1 = l[:n1]
l2 = l[n1:n1 + n2]
print(sum(l1) / n1 + sum(l2) / n2)


(n, n1, n2) = map(int, input().split())
mass = sorted(list(map(int, input().split())), reverse=1)
print(sum(mass[:min(n1, n2)]) / min(n1, n2) + sum(mass[min(n1, n2):min(n1, n2) + max(n1, n2)]) / max(n1, n2))


def urbanization(n1, n2, lst):
	(count1, count2) = (0, 0)
	if n1 > n2:
		(n1, n2) = (n2, n1)
	for i in range(n1):
		count1 += lst[i]
	for i in range(n1, n1 + n2):
		count2 += lst[i]
	return '{:.4f}'.format(count1 / n1 + count2 / n2)
(n, N1, N2) = [int(i) for i in input().split()]
a = [int(j) for j in input().split()]
print(urbanization(N1, N2, sorted(a, reverse=True)))


line = input().split()
n = int(line[0])
n1 = int(line[1])
n2 = int(line[2])
line = input().split()
c1 = 0
c2 = 0
s = 0
v = [None] * n
for i in range(n):
	v[i] = int(line[i])
v = sorted(v, reverse=True)
for i in range(n):
	x = v[i]
	if c1 == n1 and c2 == n2:
		break
	if c1 == n1:
		s += x / n2
		c2 += 1
	elif c2 == n2:
		s += x / n1
		c1 += 1
	elif x / n1 > x / n2:
		s += x / n1
		c1 += 1
	else:
		s += x / n2
		c2 += 1
print(s)


(n, n1, n2) = map(int, input().split())
if n1 > n2:
	(n1, n2) = (n2, n1)
a = list(map(int, input().split()))
a.sort()
print(sum(a[n - n1:]) / n1 + sum(a[n - n1 - n2:n - n1]) / n2)


(n, n1, n2) = map(int, input().split())
wealths = list(sorted(map(int, input().split()), reverse=True))
(n1, n2) = (min(n1, n2), max(n1, n2))
avg1 = sum(wealths[:n1]) / n1
avg2 = sum(wealths[n1:n1 + n2]) / n2
print(avg1 + avg2)


__author__ = 'Alexander'
import sys
(n, n1, n2) = map(int, sys.stdin.readline().split())
a = [int(elem) for elem in sys.stdin.readline().split()]
a = sorted(a, reverse=True)[:n1 + n2]
minval = min(n1, n2)
val = sum(a[:minval]) / minval + sum(a[minval:]) / (n1 + n2 - minval)
sys.stdout.write(str(val))


s = input().split()
n = int(s[0])
n1 = int(s[1])
n2 = int(s[2])
a = [int(x) for x in input().split()]
a.sort()
s1 = 0
s2 = 0
if n1 > n2:
	(n1, n2) = (n2, n1)
for i in range(n - 1, n - n1 - 1, -1):
	s1 += a[i]
s1 /= n1
for i in range(n - n1 - 1, n - n1 - n2 - 1, -1):
	s2 += a[i]
s2 /= n2
print(s1 + s2)


(_, n, m) = map(int, input().split())
a = list(reversed(sorted(map(int, input().split()))))
if n > m:
	(n, m) = (m, n)
print(sum(a[:n]) / n + sum(a[n:n + m]) / m)


raw = input().split()
n = int(raw[0])
n1 = int(raw[1])
n2 = int(raw[2])
a = []
raw = input().split()
for i in range(n):
	a.append(int(raw[i]))
a.sort()
ma = max(n1, n2)
mi = min(n1, n2)
res = 0
for i in range(mi):
	res += a[n - 1 - i] / mi
for i in range(ma):
	res += a[n - mi - 1 - i] / ma
print(res)


(n, n1, n2) = map(int, input().strip().split(' '))
s = list(map(int, input().strip().split(' ')))
s.sort(reverse=True)
m = min(n1, n2)
ma = max(n1, n2)
s1 = sum(s[:m]) / m
s2 = sum(s[m:m + ma]) / ma
print(s1 + s2)


import sys
import math
import bisect

def solve(A, n1, n2):
	n = len(A)
	(n1, n2) = (min(n1, n2), max(n1, n2))
	B1 = A[0:n1]
	B2 = A[n1:n1 + n2]
	return sum(B1) / n1 + sum(B2) / n2

def main():
	(n, n1, n2) = map(int, input().split())
	A = list(map(int, input().split()))
	A.sort(reverse=True)
	ans = solve(A, n1, n2)
	print('%.9f' % ans)
main()


from sys import stdin
from sys import stdout
(n, n1, n2) = (int(x) for x in stdin.readline().split())
a = sorted([int(x) for x in stdin.readline().split()], reverse=True)
minN = min(n1, n2)
maxN = max(n1, n2)
ans = sum(a[:minN]) / minN + sum(a[minN:minN + maxN]) / maxN
stdout.write('{:.9f}'.format(ans))


[n, n1, n2] = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)
s1 = 0
s2 = 0
if n1 > n2:
	(n1, n2) = (n2, n1)
for i in range(n1):
	s1 += a[i]
for i in range(n1, n1 + n2):
	s2 += a[i]
res = s1 / n1 + s2 / n2
print(res)


def rints():
	return list(map(int, input().split()))

def ri():
	return int(input())
(n, n1, n2) = rints()
wealths = rints()
if n1 > n2:
	(n1, n2) = (n2, n1)
wealths.sort(reverse=True)
print(sum(wealths[:n1]) / n1 + sum(wealths[n1:n1 + n2]) / n2)


(n, n1, n2) = map(int, input().split())
arr = [int(x) for x in input().split()]
arr.sort()
arr.reverse()
minimum = min(n1, n2)
maximum = max(n1, n2)
add = 0
add2 = 0
for i in range(minimum):
	add = add + arr[i]
ans1 = add / minimum
for j in range(minimum, minimum + maximum):
	add2 += arr[j]
ans2 = add2 / maximum
print('{:.8f}'.format(ans1 + ans2))


import sys
import math
import itertools
import collections

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
(n, n1, n2) = mi()
a = sorted(li(), reverse=True)
print(sum(a[:min(n1, n2)]) / min(n1, n2) + sum(a[min(n1, n2):n1 + n2]) / max(n1, n2))


R = lambda : list(map(int, input().split(' ')))
(n, n1, n2) = R()
a = R()
a.sort()
if n1 > n2:
	k = n1
	n1 = n2
	n2 = k
sum1 = sum([a[i] for i in range(n - n1, n)])
sum2 = sum([a[i] for i in range(n - n1 - n2, n - n1)])
sum1 /= n1 + 0.0
sum2 /= n2 + 0.0
print(sum1 + sum2)


def getLnInput():
	return input().split()

def ceilDivision(a, b):
	return (a - 1) // b + 1

def main():
	(n, n1, n2) = list(map(int, getLnInput()))
	cdwealth = list(map(int, getLnInput()))
	sw = sorted(cdwealth)[::-1]
	(n1, n2) = sorted([n1, n2])
	m1 = sum(sw[:n1]) / n1 + sum(sw[n1:n1 + n2]) / n2
	m2 = sum(sw[:n2]) / n2 + sum(sw[n2:n2 + n1]) / n1
	print(max(m1, m2))
	return
main()


import sys
LI = lambda : list(map(int, sys.stdin.readline().split()))
MI = lambda : map(int, sys.stdin.readline().split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline())
(n, a, b) = MI()
(a, b) = (max(a, b), min(a, b))
l = sorted(LI(), reverse=True)
ans = sum(l[:b]) / b + sum(l[b:b + a]) / a
print(ans)


(n, p1, p2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
if p1 < p2:
	(n1, n2) = (p1, p2)
else:
	(n1, n2) = (p2, p1)
	(p1, p2) = (p2, p1)
ans_1 = [0 for _ in range(p1)]
ans_2 = [0 for _ in range(p2)]
for i in range(p1 + p2):
	if p1:
		ans_1[p1 - 1] = a[i]
		p1 -= 1
	elif p2:
		ans_2[p2 - 1] = a[i]
		p2 -= 1
print('%.6f' % (sum(ans_1) / n1 + sum(ans_2) / n2))


(n, n1, n2) = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
if n2 > n1:
	(n1, n2) = (n2, n1)
sr2 = 0
sr1 = 0
for i in range(n - 1, n - n2 - 1, -1):
	sr2 += a[i]
for i in range(n - n2 - 1, n - n1 - n2 - 1, -1):
	sr1 += a[i]
print(sr1 / n1 + sr2 / n2)


(n1, n2, n) = sorted([int(s) for s in input().split(' ')])
a = list(sorted([-int(s) for s in input().split(' ')]))
print('{:.30}'.format(-sum(a[0:n1]) / n1 - sum(a[n1:n1 + n2]) / n2))


s = input().split()
(n, n1, n2) = (int(s[0]), min(int(s[1]), int(s[2])), max(int(s[1]), int(s[2])))
a = list(map(int, input().split()))
a.sort()
a.reverse()
print(sum(a[:n1]) / n1 + sum(a[n1:n1 + n2]) / n2)


from sys import stdin
(n, n1, n2) = map(int, stdin.readline().split())
a = sorted(map(int, stdin.readline().split()), key=lambda x: -x)
mn = min(n1, n2)
mx = max(n1, n2)
print(sum(a[:mn]) / mn + sum(a[mn:mn + mx]) / mx)


(n, n1, n2) = [int(x) for x in input().split(' ')]
arr = sorted(list(map(int, input().split(' '))), reverse=True)[:n1 + n2]
mx = min(n1, n2)
sum1 = sum(arr[:mx])
sum2 = sum(arr[mx:])
print(sum1 / mx + sum2 / (n1 + n2 - mx))


(n, n1, n2) = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
l.sort()
l = l[::-1]
mx = max(n1, n2)
mn = min(n1, n2)
print('{0:.8f}'.format(sum(l[:mn]) / mn + sum(l[mn:mx + mn]) / mx))


import sys
arr = list(map(int, input().split()))
n = arr[0]
n1 = arr[1]
n2 = arr[2]
arr2 = list(map(int, input().split()))
arr2.sort(reverse=True)
sum1 = sum2 = 0
if n1 < n2:
	for i in range(n1):
		sum1 += arr2[i]
	sum1 = sum1 / n1
	for j in range(i + 1, i + n2 + 1):
		sum2 += arr2[j]
	sum2 = sum2 / n2
elif n1 > n2:
	for i in range(n2):
		sum2 += arr2[i]
	sum2 = sum2 / n2
	for j in range(i + 1, i + n1 + 1):
		sum1 += arr2[j]
	sum1 = sum1 / n1
else:
	for i in range(0, n1 + n2, 2):
		sum1 += arr2[i]
		sum2 += arr2[i + 1]
	sum1 /= n1
	sum2 /= n2
print(sum1 + sum2)


ss = list(map(int, input().split()))
n = ss[0]
n1 = ss[1]
n2 = ss[2]
lst = list(map(int, input().split()))
lst = sorted(lst, reverse=True)
a = min(n1, n2)
b = max(n1, n2)
x = 0
y = 0
for i in range(a):
	x = x + lst[i]
for i in range(b):
	y = y + lst[a + i]
x = x / a
y = y / b
z = x + y
print(z)


(n, n1, n2) = list(map(int, input().split()))
arr = list(map(int, input().split()))
arr.sort()
arr = arr[-1::-1]
t1 = arr[:n1]
t2 = arr[n1:n1 + n2]
(x, y) = (sum(t1) / n1, sum(t2) / n2)
ans = x + y
t2 = arr[:n2]
t1 = arr[n2:n1 + n2]
(x, y) = (sum(t1) / n1, sum(t2) / n2)
ans = max(ans, x + y)
print(ans)


(n, x, y) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
if x > y:
	(x, y) = (y, x)
cx = 0
cy = 0
(m, n) = (x, y)
for i in a:
	if x > 0:
		x -= 1
		cx += i
	elif y > 0:
		y -= 1
		cy += i
	else:
		break
print(cx / m + cy / n)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
b = []
c = []
if n1 < n2:
	(p1, q1) = (0, n1)
	(p2, q2) = (n1, n1 + n2)
else:
	(p1, q1) = (n2, n1 + n2)
	(p2, q2) = (0, n2)
for i in range(p1, q1):
	b.append(a[i])
for i in range(p2, q2):
	c.append(a[i])
x = sum(b) / n1 + sum(c) / n2
print('%.8f' % x)


def solve():
	(n, n1, n2) = map(int, input().split())
	lo = min([n1, n2])
	hi = max([n1, n2])
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	s1 = sum(l[:lo])
	s2 = sum(l[lo:lo + hi])
	ans = s1 / lo + s2 / hi
	print(ans)
solve()


(n, n1, n2) = map(int, input().split())
(n1, n2) = (min(n1, n2), max(n1, n2))
l = sorted(list(map(int, input().split())))
l.reverse()
print(sum(l[:n1]) / n1 + sum(l[n1:n1 + n2]) / n2)


(n, n1, n2) = map(int, input().split())
a1 = input().split()
b = []
for i in range(n):
	b += [int(a1[i])]
b.sort()
b.reverse()
l = 0
m = 0
if n1 > n2:
	for i in range(n2):
		l += b[i]
	for i in range(n2, n2 + n1):
		m += b[i]
	ans = l / n2 + m / n1
elif n1 < n2:
	for i in range(n1):
		l += b[i]
	for i in range(n1, n2 + n1):
		m += b[i]
	ans = l / n1 + m / n2
else:
	for i in range(n1 + n2):
		l += b[i]
	ans = l / n1
print(ans)


(n, n1, n2) = map(int, input().split())
p = list(map(int, input().split()))
(n1, n2) = (min(n1, n2), max(n1, n2))
p.sort(reverse=True)
res1 = 0
res2 = 0
for i in range(n1 + n2):
	if i < n1:
		res1 += p[i]
	else:
		res2 += p[i]
print(res1 / n1 + res2 / n2)


class CodeforcesTask735BSolution:

	def __init__(self):
		self.result = ''
		self.nnn = []
		self.candidates = []

	def read_input(self):
		self.nnn = [int(x) for x in input().split(' ')]
		self.candidates = [int(x) for x in input().split(' ')]

	def process_task(self):
		self.candidates.sort(reverse=True)
		nm = min(self.nnn[1], self.nnn[2])
		nx = max(self.nnn[1], self.nnn[2])
		mean1 = sum(self.candidates[:nm]) / nm
		mean2 = sum(self.candidates[nm:nm + nx]) / nx
		sum_means = mean1 + mean2
		self.result = str(sum_means)

	def get_result(self):
		return self.result
Solution = CodeforcesTask735BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(n, n1, n2) = input().split()
n = int(n)
n1 = int(n1)
n2 = int(n2)
a = [int(i) for i in input().split()]
a.sort(reverse=True)
ma = max(n1, n2)
mi = min(n1, n2)
c1 = 0
c2 = 0
for i in range(0, mi):
	c1 = c1 + a[i]
c1 = c1 / mi
for i in range(mi, mi + ma):
	c2 = c2 + a[i]
c2 = c2 / ma
c1 = c1 + c2
print(c1)


(n, n1, n2) = [int(x) for x in input().strip().split()]
amount = [int(x) for x in input().strip().split()]
cities = sorted([n1, n2])
amount.sort(reverse=True)
mean = 0
k = 0
for i in cities:
	new = sum(amount[k:k + i])
	mean += new / i
	k = k + i
	if k >= n:
		break
print(mean)


(n, m, k) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0.0
al = sorted(l, reverse=True)
ans += sum(al[:min(m, k)]) / min(m, k)
ans += sum(al[min(m, k):m + k]) / max(m, k)
print(ans)


(n, n1, n2) = [int(x) for x in input().split()]
people = [float(x) for x in input().split()]
people.sort()
people.reverse()
min_city = min(n1, n2)
a1 = sum(people[:min_city]) / float(min_city)
max_city = max(n1, n2)
a2 = sum(people[min_city:min_city + max_city]) / float(max_city)
print('%f' % (a1 + a2))


s = input().split()
n = int(s[0])
n1 = int(s[1])
n2 = int(s[2])
s = input().split()
for i in range(n):
	s[i] = int(s[i])
s.sort()
s = s[::-1]
if n1 >= n2:
	print(sum(s[0:n2]) / n2 + sum(s[n2:n1 + n2]) / n1)
else:
	print(sum(s[0:n1]) / n1 + sum(s[n1:n1 + n2]) / n2)


(n, n1, n2) = map(int, input().split())
ast = input().split()
a = []
for v in ast:
	a.append(int(v))
a.sort(reverse=True)
if n1 <= n2:
	s1 = a[0:n1]
	s2 = a[n1:n1 + n2]
	sum1 = sum(s1)
	sum2 = sum(s2)
	aver = sum1 / n1 + sum2 / n2
else:
	s1 = a[0:n2]
	s2 = a[n2:n1 + n2]
	sum1 = sum(s1)
	sum2 = sum(s2)
	aver = sum1 / n2 + sum2 / n1
print(aver)


(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
s = min(n1, n2)
b = max(n1, n2)
a.sort()
print(sum(a[-s:]) / s + sum(a[-s - b:-s]) / b)


(n, n1, n2) = map(int, input().split())
l = [int(a) for a in input().split()]
l.sort()
if n1 > n2:
	(n1, n2) = (n2, n1)
print(sum(l[n - n1:]) / n1 + sum(l[n - n1 - n2:n - n1]) / n2)


n = sorted(map(int, input().split()))
a = sorted(map(int, input().split()))
print(sum(a[-n[0]:]) / n[0] + sum(a[-n[0] - n[1]:-n[0]]) / n[1])


(n, n1, n2) = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
minN = min(n1, n2)
maxN = max(n1, n2)
ans1 = 0.0
ans2 = 0.0
for i in range(minN):
	ans1 += l[i]
ans1 /= minN
for i in range(maxN):
	ans2 += l[i + minN]
ans2 /= maxN
print(ans1 + ans2)


n = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
l.sort()
ind = 0
if n[1] <= n[2]:
	ind = len(l) - n[1]
	s1 = sum(l[ind:]) / n[1]
	s2 = sum(l[ind - n[2]:ind]) / n[2]
	print('%.8f' % (s1 + s2))
else:
	ind = len(l) - n[2]
	s1 = sum(l[ind:]) / n[2]
	s2 = sum(l[ind - n[1]:ind]) / n[1]
	print('%.8f' % (s1 + s2))


import math
(n, n1, n2) = map(int, input().split())
s = input().split()
r = []
for i in range(n):
	a = int(s[i])
	r.append(a)
r.sort()
r = r[::-1]
if n1 > n2:
	d = n2
else:
	d = n1
if d == n2:
	m1 = sum(r[0:d]) / d
	m2 = sum(r[d:d + n1]) / n1
else:
	m1 = sum(r[0:d]) / d
	m2 = sum(r[d:d + n2]) / n2
a = m1 + m2
print('{0:.8f}'.format(a))


(n, n1, n2) = map(int, input().split())
nums = map(int, input().split())
people = sorted(nums, reverse=True)
(n1, n2) = (min(n1, n2), max(n1, n2))
c1 = sum(people[:n1]) / n1
c2 = sum(people[n1:n1 + n2]) / n2
print('%.7f' % (c1 + c2))


from sys import stdin

def max_mean_wealth(n, n1, n2, a):
	max_mean = 0
	sm = min(n1, n2)
	lg = max(n1, n2)
	a = sorted(a)[::-1]
	for i in range(sm):
		max_mean += a[i] / sm
	for j in range(i + 1, i + 1 + lg):
		max_mean += a[j] / lg
	return max_mean
read_ints = lambda : [int(c) for c in stdin.readline().split(' ')]
(n, n1, n2) = read_ints()
a = read_ints()
print(max_mean_wealth(n, n1, n2, a))


from copy import *
(n, n1, n2) = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
if n > n1 + n2:
	a = a[n - n1 - n2:len(a)]
if n2 > n1:
	(n1, n2) = (n2, n1)
b = a[:n1]
c = a[n1:n1 + n2]
print(sum(b) / n1 + sum(c) / n2)


(n, n1, n2) = map(int, input().split())
ip = sorted(list(map(int, input().split())))
s1 = 0
s2 = 0
(n1, n2) = (min(n1, n2), max(n1, n2))
for i in range(1, n1 + 1):
	s1 += ip[-i]
for i in range(n1 + 1, n1 + n2 + 1):
	s2 += ip[-i]
print(s1 / n1 + s2 / n2)