#Lutece3226. 树上序列
树上序列
Migrated from Lutece 3226 树上序列
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给定一棵 个点且以 为根的有根树,及常数 。
求序列 的个数,满足
其中 表示节点 的父节点。答案对 取模。
Input
第一行,两个正整数 和 。
接下来 行,每行两个正整数,描述一条边 。
Output
一行,一个整数,表示答案。
Samples
4 3
2 1
3 1
4 1
36
Constraints
,
Resources
2024 UESTC ICPC Training for Math