#P2796. Facer的程序
Facer的程序
Description
Facer is a cute coder. He wrote programs. The programs are cleverly related: any two programs are connected by exactly one chain.
Specifically, for programs , there exists and only exists one sequence such that are directly connected, are directly connected, and so on, are directly connected. A set of programs that satisfies this is called a program block.
Now, given the connections within one program block, determine how many sub-blocks it has. That is, choose a subset of programs such that also satisfies the condition above.
Input Format
The first line contains a positive integer .
The next lines each contain two integers, representing two programs that are directly connected.
Output Format
Output the number of sub-blocks, modulo .
3
1 2
2 3
6
Hint
Sample Explanation:
The subsets satisfy the condition above.
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号