PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000057. Pasha và tiệc trà (Pasha and Tea)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Pasha và tiệc trà (Pasha and Tea)

Pasha and Tea

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

There are 2n2n cups with capacities aia_i, for nn girls and nn boys, with a teapot holding ww milliliters. Every girl gets xx and every boy gets 2x2x. Assign cups and pour no more than each cup or teapot allows, maximizing total poured water.

Input

Line 1: n,wn,w. Line 2: 2n2n cup capacities aia_i.

Output

Print the maximum total water with absolute or relative error at most 10−610^{-6}.

Subtasks

  • Subtask 1 (20 points): 1≤n≤51\le n\le 5; 1≤w≤1091\le w\le 10^9; 1≤ai≤1091\le a_i\le 10^9 for every ii.
  • Subtask 2 (30 points): 1≤n≤10001\le n\le 1000; 1≤w≤1091\le w\le 10^9; 1≤ai≤1091\le a_i\le 10^9 for every ii.
  • Subtask 3 (50 points): 1≤n≤1000001\le n\le 100000; 1≤w≤1091\le w\le 10^9; 1≤ai≤1091\le a_i\le 10^9 for every ii.

Examples

Input

1 5
2 3

Output

4.500000000000

Explanation

Assign the size-2 cup to the girl and the size-3 cup to the boy. The girl can receive at most 1.5, the boy 3, for a total of 4.5; the teapot capacity 5 is not binding.