cf/mirror

Alesya and Discrete Math

CF
1179E3200· legendary gm5s256 MB⇄ interactive

Examples

Sample 1of 1
Input
5 5
? 1 0
? 1 1
? 2 1
? 2 2
? 3 2
? 3 3
? 4 3
? 4 4
? 5 4
? 5 5
!
0 1
1 2
2 3
3 4
4 5
Output
0
1
1
2
2
3
3
4
4
4
5
1179E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)