|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||0||0||0||0.000%|
Sven the Polar Bear (the mascot of the various Swedish national teams in science sports) plays hide and seek with Gloria the Hippo (the mascot from Madagascar). The game is played in a network of $m$ caves, numbered between $0$ and $m - 1$. The caves are connected by $m - 1$ tunnels (each between two distinct caves), such that there is a path between any pair of caves.
Each round starts with Gloria hiding in one of the caves (except cave $0$) with uniform probability. Sven, starting in cave $0$, then has $n$ seconds to find Gloria. Each tunnel takes some number of seconds for Sven to traverse depending on the length of the tunnel, and can be traversed in both directions.
Sven likes to win, so he wants to choose his movements in such a way that he maximizes the probability of finding Gloria before the $n$ seconds are up. How many caves does Sven have time to visit?
The input consists of:
Output the maximum number of caves Sven can visit, excluding the cave he starts in.
11 50 0 1 5 1 2 4 1 3 9 0 4 6 4 5 6 5 6 3 0 7 8 7 8 10 7 9 5 9 10 2