cf/mirror

Chess Team Forming

CF
1533E2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
5
10 3 4 6 1
9 4 2 5 9 8
5
1 7 6 4 8
Output
4 2 3 4 2
Sample 2of 3
Input
3
5 1 8
8 2 10 1
10
1 2 3 4 5 6 7 8 9 10
Output
3 3 3 3 3 2 2 2 1 0
Sample 3of 3
Input
1
10
10 5
2
5 15
Output
0 -5
1533E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)