cf/mirror

Dances (Hard Version)

CF
1883G21900· candidate master3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
4
2 4
1
3 2
4 7
5 1 5
3 8 3 3
8 4
4 3 3 2 2 1 1
1 1 1 1 3 3 3 3
9 1
9 2 8 3 7 4 6 5
1 2 3 2 1 4 5 6 5
Output
2
12
16
4
1883G2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)