QOJ.ac

QOJ

时间限制: 3 s 内存限制: 1536 MB 总分: 100 可 Hack ✓

#3000. Hope

统计

Sulawesi. There are $L$ units of time left before the Earth reaches the Roche limit of Jupiter.

Cai Deren has received the "Ignite Jupiter" plan from Aelfin. The plan requires him to gather all nearby rescue teams to the same steering engine, clear the obstacles, and use the "Spring Festival Twelve Rings" program to manipulate the engine and ignite Jupiter.

There are $n$ steering engines, connected by $n-1$ roads. Any two steering engines can reach each other through the roads, and the distance between them is the number of edges on the shortest path.

There are $k$ rescue teams $s_1, s_2, \dots, s_k$ deployed nearby, and each rescue team has a rescue range. A rescue range is a connected subset of the set of steering engines, such that all engines on the path between any two engines in the subset are also in the rescue range.

We say an engine $u$ is reachable by a rescue team with rescue range $S$ if and only if $u \in S$, and the distance from any engine $v \in S$ to $u$ is no greater than $L$. This way, no matter where the rescue team is at their post, they can reach engine $u$ before time runs out.

Cai Deren needs to command the $k$ rescue teams to gather at the same engine. However, due to communication failure, Cai Deren does not know the rescue range of each team. He wants to calculate the number of feasible scheduling plans, so he inputs the problem into a computer.

On the other side of this computer—you, need to help him count how many possible deployment plans exist such that there is an engine reachable by all rescue teams. A plan refers to a set of rescue ranges $\{S_1, S_2, \dots, S_k\}$; two plans are different if and only if the rescue range $S_i$ of some rescue team $s_i$ is different in the two plans. In this saturation rescue planned by the United Government, the rescue ranges of two teams may intersect or even be identical.

You know the answer is very large. Snowmobiles shuttle between thousands of landmarks, and the possible rescue ranges are vast, but the plans that gather all teams are few and far between. However, you have no time to despair, not even time to calculate that number.

You only need to calculate the result of the answer modulo $998244353$.

Input

The first line contains three integers $n$, $L$, and $k$, representing the number of steering engines, the remaining time to save the Earth, and the number of rescue teams, respectively.

The next $n-1$ lines each contain two integers $u$ and $v$, representing a road between the $u$-th and $v$-th steering engines.

Output

A single integer representing the number of plans modulo $998244353$.

Examples

Input 1

2 1 2
1 2

Output 1

7

Input 2

4 1 1
1 2
2 3
3 4

Output 2

9

Note 2

There is only one rescue team, and all plans are feasible except for the one where the rescue range is the full set $\{1,2,3,4\}$.

Input 3

5 1 1
1 2
1 3
2 4
2 5

Output 3

14

Input 4

See hope/hope4.in and hope/hope4.ans in the contestant directory.

Output 4

See hope/hope4.in and hope/hope4.ans in the contestant directory.

Note 4

The graph for this test case is shown below:

Input 5

See hope/hope5.in and hope/hope5.ans in the contestant directory.

Output 5

See hope/hope5.in and hope/hope5.ans in the contestant directory.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

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.