Word problem involving the maximum or minimum of a quadratic function