This problem is in Contest(s) below:
Contest 1955:acm集训队第四周测试
Contest 1956:acm集训队第四周测试补题