Problem5814--IOI2021 练习赛 T3:Finding Routers (routers)

5814: IOI2021 练习赛 T3:Finding Routers (routers)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

Input

Output

Constraints

Sample 1 Input

5 2 10
0 4 

Sample 1 Output

0 4
2

Sample 2 Input

6 3 10
0 2 6 

Sample 2 Output

0 2 6
5

HINT

题目来源:IOI2021 练习赛 T3。

Source/Category