a121: 質數又來囉

http://zerojudge.tw/ShowProblem?problemid=a121