Universal Cup Judging System

Universal Cup

Time Limit: 2.0 s Memory Limit: 2048 MB Total points: 100 Difficulty: [show] Hackable ✓
Statistics

Jayce is playing a game of ARAM: Mayhem. He has reached the Augment Selection phase and is looking for the perfect augmentation to carry his team. Specifically, he is desperately hunting for the Golden augment known as Slow and Steady.

problem_16335_d8c98da6fac715f321d5428116fbdb05.png
The Game UI for card selection. Oops, it looks like Jayce cannot find Slow and Steady in the Prismatic pool...

Currently, the game interface presents $k$ augment cards to Jayce. While each card has a different effect, to Jayce, the $i$-th visible card is worth $a_i$ value points. There is a hidden pool of $n$ other augment cards waiting in the deck. The value points of these cards are known to be the multiset $\{b_1, b_2, \dots, b_n\}$, but their order is shuffled uniformly at random.

Jayce can refresh each of the $k$ card slots at most once. The process works as follows:

  • There are individual reroll buttons under each of the $k$ cards (as shown in the game UI).
  • Jayce can choose a slot that hasn't been rerolled yet, discard the current card, and draw the top card from the deck to replace it.
  • Jayce sees the result of a reroll immediately before deciding his next move: whether to reroll another available slot, or stop.

At the end of the process, Jayce will select one card among the $k$ cards currently visible on the screen.

Jayce plays optimally to maximize the expected value of the card he eventually picks. Calculate this maximum expected power level.

Input

The first line contains two integers $k$ and $n$ ($1 \le k \le n \le 10^5$), indicating the number of visible slots and the number of cards in the deck.

The second line contains $k$ integers $a_1, a_2, \dots, a_k$ ($-10^5 \le a_i \le 10^5$), indicating the power levels of the initially visible cards.

The third line contains $n$ integers $b_1, b_2, \dots, b_n$ ($-10^5 \le b_i \le 10^5$), indicating the power levels of the cards in the deck.

Output

Output the maximum expected value of the card as a single decimal real number.

Your answer will be considered correct if its absolute or relative error does not exceed $10^{-4}$. Formally speaking, suppose that your output is $a$ and the jury's answer is $b$, your output is accepted if and only if $\frac{|a - b|}{\max(1, |b|)} \le 10^{-4}$.

Examples

Input 1

1 2
10
1 100

Output 1

50.5

Input 2

3 5
3 4 7
1 2 3 5 8

Output 2

7.4

Input 3

2 4
-1 -2
-3 -4 -5 -6

Output 3

-1

Input 4

5 14
1 3 5 7 9
-1 -1 0 0 2 2 4 4 6 6 8 8 10 10

Output 4

9.505494505

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.