Distributed Finite-Time Algorithm for a Class of Quadratic Optimization Problems with Time-Varying Linear Constraints