Tree Country has N cities, numbered 1 to N. Its road network forms a tree. That is, there are N−1 two-way roads and every city is connected, so you can always travel between any two cities.
K employees of one company are moving to Tree Country. Every employee must live in a different city, so you have to pick K cities. One condition applies: the cities where the employees live must be connected to one another. If two employees live in cities i and j, then every city on the path between i and j must also have an employee living in it.
Given the tree structure of Tree Country, write a program that counts the ways to pick the K cities.