#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 stones for Red and stones for Blue. The -th Red stone is positioned at and the -th Blue stone is positioned at .
Let be the position of the center of the target area. A Red stone at scores if it is strictly closer to than every Blue stone:
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 . The center can be any real number, not necessarily an integer.
输入格式
There are multiple test cases. The first line contains an integer , the number of test cases. For each test case:
The first line contains two positive integers and , the number of stones for Red and Blue.
The second line contains integers , the positions of the Red stones.
The third line contains integers , the positions of the Blue stones.
输出格式
For each test case, output one line containing the maximum possible score of Red, not the position . If Red cannot win for any choice of , output Impossible.
提示
For the first sample test case, choosing makes the Red stones at positions and score.
For the second sample test case, choosing makes the Red stones at positions 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