This problem is in Contest(s) below:
Contest 1261:简单数论题
Contest 1342:数论的题
Contest 1448:11,12月初一训练
Contest 1441:YC-NOIP普及