Time limit
2000 ms
Memory limit
262144 kB
Source
Educational Codeforces Round 56 (Rated for Div. 2)
Tags
dfs and similar graphs *1600
Editorial
Announcement Tutorial
Descriptions:

Beautiful Graph

CodeForces - 1093D