cf/mirror

Sofa Thief

CF
818C2000· candidate master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
2
3 2
3 1 3 2
1 2 2 2
1 0 0 1
Output
1
Sample 2of 3
Input
3
10 10
1 2 1 1
5 5 6 5
6 4 5 4
2 1 2 0
Output
2
Sample 3of 3
Input
2
2 2
2 1 1 1
1 2 2 2
1 0 0 0
Output
-1
818C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)