#P14807. [CCPC 2024 哈尔滨站] 欢迎加入线上会议!

    ID: 14704 远端评测题 2000ms 1024MiB 尝试: 0 已通过: 0 难度: 5 上传者: 标签>图论2024Special Judge广度优先搜索 BFSCCPC哈尔滨

[CCPC 2024 哈尔滨站] 欢迎加入线上会议!

Description

You want to organize an online meeting on MeLink with nn participants numbered form 11 to nn. Each of these nn 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 nn participants are present. However, there are kk 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 nn participants into the meeting. If it is possible, determine an inviting plan.

Input Format

The first line contains three integers n,m,kn, m, k (2n2×1052 \le n \le 2 \times 10^5, $1 \le m \le \min\{5 \times 10^5, \frac{n(n-1)}{2}\}$, 0kn0 \le k \le n), representing the number of participants, the number of acquaintance relationships, and the number of participants currently busy.

The second line contains kk integers a1,,aka_1, \ldots, a_k (1ain1 \le a_i \le n), where the ii-th integer represents that participant aia_i is busy. These integers are all distinct. If k=0k=0, this line will be empty, but not omitted.

The next mm lines each contain two integers pip_i and qiq_i (1pi,qin1 \le p_i, q_i \le n, piqip_i \neq q_i), indicating that pip_i and qiq_i 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 nn participants, output No\texttt{No} in the first line.

If it is possible, output Yes\texttt{Yes} in the first line. Then, in the second line, output an integer tt (1tn1 \le t \le n), representing the number of steps required to organize the meeting.

In the following tt lines, each line describes one step of organizing the meeting. In the jj-th line, first output an integer xjx_j (1xjn1 \leq x_j \leq n). If j=1j=1, xjx_j represents the participant who creates the meeting; otherwise, xjx_j must be a participant who has already joined the meeting. All xjx_j must be distinct. Next, output an integer yjy_j (1yjn1 \leq y_j \leq n), representing the number of participants invited by xjx_j in this step. Finally, output yjy_j integers zlz_l (1zln1 \leq z_l \leq n), representing the participants invited by xjx_j. All zlz_l must be distinct, and no participant can be invited more than once during the entire process.

You do not need to minimize tt; 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