Mughals Attack

0

0 votes
Problem

Mughal forces conquered the Gondwana kingdom.Now Akbar proceed to conquer Byteland Kingdom.

Kingdom has 'N' cities and there is only ony way to go from one city to another by roads.

But As we know that Byteland forces are too much strong so Akbar decided to conquer connected Area of byteland kingdom such that Area only connect by exactly 'X' edges to the remaining Kingdom.

Here , Connected Area : cities conquered by Mughals must be such that there is always a way to reach from one city to another.

enter image description here

Now , Akbar asked you to tell the number of such Areas over which Mughals can attack.

Input:

The first line contains two integers N and X followed by N-1 lines each containing two integers cities u & v denoting that there's a road between u & v.

Output:

Print the integer which denotes number of possible Connected Areas.

Constraints:

1 <= X <= N <= 100

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Akbar has 4 ways to conquer = {2},{3},{1,2},{1,3}

Editor Image

?