Codeforces 1165 F2 Microtransactions (hard version) —— 二分

NoSuchKey