cf/mirror

Hard Demon Problem

CF
2044H2100· master3.5s512 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
2
4 3
1 5 2 4
4 9 5 3
4 5 2 3
1 5 5 2
1 1 4 4
2 2 3 3
1 2 4 3
3 3
1 2 3
4 5 6
7 8 9
1 1 1 3
1 3 3 3
2 2 2 2
Output
500 42 168
14 42 5
2044H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)