Maximum by minimum
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Directed unweighted graph is given. Find in it a vertex, the shortest distance from which to the given one is maximum, and print this distance.
Input
First line contains three positive integers и — the number of vertices and edges in the graph and the number of given vertex. In the next lines the graph edges are given. Each edge is given with the pair of numbers — the starting and the ending point.
Output
Print the required shortest distance.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 4K
Acceptance rate 34%