Time limit
1000 ms
Memory limit
262144 kB
Source
Codeforces Round #228 (Div. 2)
Tags
constructive algorithms graphs implementation shortest paths *2000
Editorial
Announcement Tutorial
Descriptions:

Fox and Minimal path

CodeForces - 389D