##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given a simple directed graph with vertices, numbered from to .
For every two distinct vertices and , the graph does not contain both edges and .
It is guaranteed that the graph contains a directed Hamiltonian cycle.
Find a cyclic ordering of all vertices. An index is called good if the graph contains the edge , where .
Your ordering must have at least good indices.
For each test case, output any cyclic ordering satisfying the requirement.
The ordering contains every vertex once. All three cyclic consecutive pairs, including , are edges of the graph.
The cyclic consecutive pairs are , , , and , so all four indices are good.
The ordering follows the directed cycle , giving five good indices.
Five indices are good: the graph contains , , , , and . The pair does not need to be an edge.
The ordering follows the directed cycle , so every index is good.