TopCoder

$\huge 南ことり$

100.0% (5/5)

75.0% (6/8)

3
3 9
3 2 3
2 1 2
3 2 3
4 3
5 3 2 3
4 2 1 2
5 3 2 3
4 2 3 2
3 1
1 2 3
2 1 2
3 2 3

2
3
Impossible