The quadratic problem for systems with time delays