cf/mirror

Traveling in Berland

CF
1809F2500· grandmaster2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
4
3 5
3 4 4
1 2 2
5 7
1 3 2 5 1
2 1 1 1 2
4 3
1 2 1 3
2 2 2 2
3 2
2 2 2
1 2 1
Output
17 19 17
13 12 12 12 14
14 14 14 14
8 8 8
1809F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…