QOJ.ac

QOJ

Limite de temps : 6 s Limite de mémoire : 512 MB Points totaux : 100

#831. Airplane Cliques

Statistiques

There are $n$ cities in Saint Waterloo. They are connected with $n - 1$ undirected airlines, such that it is possible to get from any city to any other city by using airlines.

Let’s say that the two cities are in a good relationship if it is possible to get from one to another using at most $x$ flights.

Additionally, let’s say that the set of $k$ cities is friendly if all pairs of cities in it are in a good relationship. You need to find the number of friendly sets of cities for each $k$, such that $1 \le k \le n$. As these values may be very large, find them modulo $998\,244\,353$.

Input

The first line of input contains two integers $n, x$ ($1 \le n \le 300\,000$, $0 \le x \le n - 1$): the number of cities in Saint Waterloo and $x$.

The next $n - 1$ lines contain descriptions of edges, such that the $i$-th line contains two integers $a, b$ ($1 \le a, b \le n$), the indices of cities connected by the $i$-th airline.

Output

Print $n$ integers: the number of friendly sets of $1, 2, \dots, n$ cities, modulo $998\,244\,353$.

Examples

Input 1

1 0

Output 1

1

Input 2

5 1
1 2
2 3
3 4
4 5

Output 2

5 4 0 0 0

Input 3

4 2
1 2
1 3
1 4

Output 3

4 6 4 1

Note

In the second example, all possible friendly sets are of size 1 and 2, and the number of friendly sets for these sizes is the number of cities and the number of airlines, respectively.

In the third example, it is possible to get from any city to any other city using at most $x$ flights, so the number of friendly sets of $k$ cities is $\binom{4}{k}$.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1135EditorialOpen题解vme502026-02-26 07:12:37View

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.