This problem is in Contest(s) below:
Contest 1064:2011春高级班第9课练习
Contest 1470:素数
Contest 1875:19暑假拓展e
Contest 1399:常训第六课作业