LearnPy Hub
← Arena
IntermediateRating 1300

Friends k Steps Away

In an undirected graph, count the nodes whose shortest distance from node 1 is exactly k.

Input

n, m and k; then m lines 'u v'.

Output

One integer.

Sample 1

Input
5 4 2
1 2
1 3
2 4
4 5
Output
1

Sample 2

Input
3 0 0
Output
1
solution.py
Output appears here
Friends k Steps Away · Python Arena problem · LearnPy Hub