cf/mirror

Sereja and the Arrangement of Numbers

CF
367C2000· candidate master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
5 2
1 2
2 3
Output
5
Sample 2of 3
Input
100 3
1 2
2 1
3 1
Output
4
Sample 3of 3
Input
1 2
1 1
2 100
Output
100
367C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…