This problem is in Contest(s) below:
Contest 1174:基础课程-计数DP
Contest 1191:2026寒假集训基础强化班