This problem is in Contest(s) below:
Contest 2199:信1821-1、2C++(函数)
Contest 2077:信1702-1C++(函数)