质数筛+计数dp吧