##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given a strongly connected directed graph with vertices and edges.
For two vertices and , let be the minimum number of edges in a directed path from to .
The directed diameter of the graph is the maximum value of over all ordered pairs of vertices .
You do not need to find the directed diameter exactly. You only need to output an ordered pair of vertices whose distance is at least half of the directed diameter.
More formally, let be the directed diameter of the graph. You have to output two vertices and such that .
The input is given in the following format:
Each edge is directed from to .
For each test case, output two integers and , describing the ordered pair of vertices you choose.
If the directed diameter of the graph is , your output must satisfy .
The output format is:
There is a directed path from to with length : .
The pair has distance , so the shown output is not optimal. Still, the shown distance is enough because .