Codeforces Round #627 (Div. 3) D. Pair of Topics【离散化+树状数组 / 或者:思维题的简单方法】

NoSuchKey