cf/mirror

Finding the Vertex

CF
1444E3500· legendary gm1s512 MB⇄ interactive

Examples

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