D. Zero Quantity Maximization(CF: Codeforces Round #544 (Div. 3))

NoSuchKey