This problem is in Contest(s) below:
Contest 2840:2025暑假集训-深度优先搜索(2)
Contest 2651:2024暑假集训-深度优先搜索(2)
Contest 2804:计算机24C1+24E1-专业课程设计2-深搜算法