You have a humidifier that starts empty, and you will add water to it several times at different times. Each time you add water, some water will evaporate over time, and you need to find out how much water is left in the humidifier after the last addition.
Input: 4, [(1, 3), (3, 1), (4, 4), (7, 1)]
Output: 3
Input: 3, [(1, 8), (10, 11), (21, 5)]
Output: 5