This problem is in Contest(s) below:
Contest 5975:AK语法提高A班 自定义函数