cf 1249 D2. Too Many Segments (hard version) (贪心+multiset)

NoSuchKey