This problem is in Contest(s) below:
Contest 1951:test0813
Contest 1958:acm集训队第五周测试