This problem is in Contest(s) below:
Contest 1268:ACM训练题一(大一)