View as PDF

Points: 7
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Stephen loves bread. He loves it so much that he knows every bakery in the city. There are bakeries, named with routes connecting them. The tastiness of the bread, , is determined based on its distance from Stephen's house. The farther away the bakery, the better the bread tastes. Stephen lives at bakery and wants to know how tasty the tastiest bread is.

Note: Stephen will only take the most optimal (shortest) path to each bakery.

#### Input Specification

The first line of input will contain two integers, and , the number of bakeries and number of roads, respectively.

The next lines will contain two integers and , indicating the bakery and bakery are connected.

#### Output Specification

Output one integer , the taste of the tastiest bread Stephen can get.

#### Sample Input

5 4
1 2
1 3
2 4
4 5

#### Sample Output

3