spoj; solve "Prime Generator"