End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
stack to store pairs [price, span] in a monotonically decreasing order.next(price), do the following:
span to 1 (the current day).price, pop the top element from the stack and add its span to the current span.[price, span] onto the stack.span.