cf/mirror

Polygonal Segments

CF
1990F2800· international gm8s512 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
2
5 6
3 1 2 2 8
1 1 3
1 1 4
1 1 5
2 1 5
1 1 4
1 1 5
4 10
500000000000 500000000000 1000000000000 500000000000
1 1 3
1 2 4
1 1 4
2 1 499999999999
2 3 999999999999
1 1 3
1 2 4
1 1 4
2 3 1000000000000
1 1 3
Output
-1
4
4
3
5
-1
-1
4
-1
3
4
-1
1990F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)