cf/mirror

Remove at the lowest cost

CF
2176E2400· grandmaster3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
2
10
5 5 8 10 4 3 4 10 5 5
10 3 9 6 9 8 7 8 10 3
1 10 2 9 5 6 7 4 3 8
4
1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000
1 2 4 3
Output
42 36 30 30 30 12 12 12 0 0 0
3000000000 0 0 0 0
2176E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…