#2698 Awkward Group

2 s   128 MB  

Description

Input

Output

Sample Input

Sample Output

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

Source

Asia Regional - Daejeon Nationalwide Internet Competition 2015 A / (data set by wowoto9772)