This problem is in Contest(s) below:
Contest 1245:数论入门
Contest 1345:数论的题2
Contest 1281:数论入门
Contest 1082:数论入门
Contest 1174:数论入门