Minimizing Quadratic Functions in Constant Time