# AtCoder Beginner Contest 160

URL: https://atcoder.jp/contests/abc160 (opens new window)

# E

x,y,a,b,c = gets.chomp.split(" ").map(&:to_i)
p_arr = gets.chomp.split(" ").map(&:to_i).sort_by{|n| -n}
q_arr = gets.chomp.split(" ").map(&:to_i).sort_by{|n| -n}
r_arr = gets.chomp.split(" ").map(&:to_i)

x_arr = p_arr[0..x-1]
y_arr = q_arr[0..y-1]

puts (x_arr + y_arr + r_arr).sort_by{|n| -n}[0..x+y-1].sum
Last Updated: 2020/08/18 23:38