cf/mirror

New Year's Problem

CF
1619D1800· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
5
 
2 2
1 2
3 4
 
4 3
1 3 1
3 1 1
1 2 2
1 1 3
 
2 3
5 3 4
2 5 1
 
4 2
7 9
8 1
9 6
10 8
 
2 4
6 5 2 1
7 9 7 2
Output
3
2
4
8
2
1619D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)