This problem is in Contest(s) below:
Contest 1004:竞赛中等题型练习
Contest 1030:枚举算法专题
Contest 1166:枚举算法入门