#P14807. [CCPC 2024 哈尔滨站] 欢迎加入线上会议!
[CCPC 2024 哈尔滨站] 欢迎加入线上会议!
Description
You want to organize an online meeting on MeLink with participants numbered form to . Each of these participants knows at least one other participant besides themselves, and the acquaintance relationship is mutual.
The organization process of the meeting is as follows: First, one person creates the meeting and joins it. Then, members who have already joined the meeting can invite some of their acquaintances who are not yet in the meeting, until all participants are present. However, there are participants who are currently busy debugging code; these people can be invited to the meeting but cannot create the meeting or invite others.
You want to determine if it is possible to get all participants into the meeting. If it is possible, determine an inviting plan.
Input Format
The first line contains three integers (, $1 \le m \le \min\{5 \times 10^5, \frac{n(n-1)}{2}\}$, ), representing the number of participants, the number of acquaintance relationships, and the number of participants currently busy.
The second line contains integers (), where the -th integer represents that participant is busy. These integers are all distinct. If , this line will be empty, but not omitted.
The next lines each contain two integers and (, ), indicating that and know each other. The acquaintance relationships are mutual. It is guaranteed that the same acquaintance relationship will not appear more than once, and that every participant knows at least one other person.
Output Format
If it is impossible to organize a meeting with all participants, output in the first line.
If it is possible, output in the first line. Then, in the second line, output an integer (), representing the number of steps required to organize the meeting.
In the following lines, each line describes one step of organizing the meeting. In the -th line, first output an integer (). If , represents the participant who creates the meeting; otherwise, must be a participant who has already joined the meeting. All must be distinct. Next, output an integer (), representing the number of participants invited by in this step. Finally, output integers (), representing the participants invited by . All must be distinct, and no participant can be invited more than once during the entire process.
You do not need to minimize ; any valid plan is acceptable.
4 5 2
3 4
1 2
1 3
2 3
3 4
2 4
Yes
2
1 2 2 3
2 1 4
4 5 3
2 4 3
1 2
1 3
2 3
3 4
2 4
No
京公网安备 11011102002149号