Let's Play Curling
题号:NC216012
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Curling is a sport in which players slide stones on a sheet of ice toward a target area. The team with the nearest stone to the center of the target area wins the game.

Two teams, Red and Blue, are competing on the number axis. After the game there are stones remaining on the axis, n of them for the Red team and the other m of them for the Blue. The i-th stone of the Red team is positioned at a_i and the i-th stone of the Blue team is positioned at b_i.

Let c be the position of the center of the target area. From the description above we know that if there exists some i such that and for all we have then Red wins the game. What's more, Red is declared to win p points if the number of i satisfying the constraint is exactly p.

Given the positions of the stones for team Red and Blue, your task is to determine the position c of the center of the target area so that Red wins the game and scores as much as possible. Note that c can be any real number, not necessarily an integer.

输入描述:

There are multiple test cases. The first line of the input contains an integer T indicating the number of test cases. For each test case:

The first line contains two integers n and m () indicating the number of stones for Red and the number of stones for Blue.

The second line contains n integers () indicating the positions of the stones for Red.

The third line contains m integers () indicating the positions of the stones for Blue.

It's guaranteed that neither the sum of n nor the sum of m will exceed .

输出描述:

For each test case output one line. If there exists some c so that Red wins and scores as much as possible, output one integer indicating the maximum possible score of Red (NOT c). Otherwise output "Impossible" (without quotes) instead.
示例1

输入

复制
3
2 2
2 3
1 4
6 5
2 5 3 7 1 7
3 4 3 1 10
1 1
7
7

输出

复制
2
3
Impossible

备注:

For the first sample test case we can assign  so that the stones at position 2 and 3 for Red will score.

For the second sample test case we can assign so that the stones at position 5 and 7 for Red will score.