#P3758. [TJOI2017] 可乐
[TJOI2017] 可乐
Description
The people on the planet Jialidun (pinyin) love drinking cola. Therefore, their enemy planet developed a cola robot and placed it in city of planet Jialidun. This cola robot has three possible actions: stay where it is, go to an adjacent city, or self-destruct. Every second, it randomly triggers one of these actions. Given the city graph of planet Jialidun, and that at time the cola robot is in city , after seconds, how many behavior sequences could the cola robot have?
Input Format
The first line contains two positive integers , . is the number of cities, and is the number of roads. Then lines follow, each containing two integers , , indicating there is a road between and . There is at most one road between any pair of cities, and no road connects a city to itself. The last line contains an integer , the elapsed time.
Output Format
Output the number of behavior sequences of the cola robot. Since the answer can be large, output the result modulo .
3 2
1 2
2 3
2
8
Hint
Sample Input/Output 1 Explanation
- -> self-destructs.
- -> -> self-destructs.
- -> -> self-destructs.
- -> -> .
- -> -> .
- -> -> .
- -> -> .
- -> -> .
Constraints
- For of the testdata, .
- For of the testdata, , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号