Codeforces 1497E2 线性筛 + 尺取法 + DP

NoSuchKey