This problem is in Contest(s) below:
Contest 1255:语言基础班第四天
Contest 1555:C++校本
Contest 1949:零基础第一节