#NC216012. Let's Play Curling

Let's Play Curling

题目描述

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. There are nn stones for Red and mm stones for Blue. The ii-th Red stone is positioned at aia_i and the jj-th Blue stone is positioned at bjb_j.

Let cc be the position of the center of the target area. A Red stone at aia_i scores if it is strictly closer to cc than every Blue stone:

∣ai−c∣<∣bj−c∣for all 1≤j≤m.|a_i-c|<|b_j-c|\qquad\text{for all }1\le j\le m.

Red wins if at least one Red stone scores, and its score is the number of Red stones satisfying this condition.

Given the positions of the stones, find the maximum score Red can obtain by choosing cc. The center cc can be any real number, not necessarily an integer.

输入格式

There are multiple test cases. The first line contains an integer TT, the number of test cases. For each test case:

The first line contains two positive integers nn and mm, the number of stones for Red and Blue.

The second line contains nn integers a1,…,ana_1,\ldots,a_n, the positions of the Red stones.

The third line contains mm integers b1,…,bmb_1,\ldots,b_m, the positions of the Blue stones.

输出格式

For each test case, output one line containing the maximum possible score of Red, not the position cc. If Red cannot win for any choice of cc, output Impossible.

提示

For the first sample test case, choosing c=2.5c=2.5 makes the Red stones at positions 22 and 33 score.

For the second sample test case, choosing c=7c=7 makes the Red stones at positions 5,7,75,7,7 score.

样例 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

来源

牛客原题