A discontinuous algorithm for distributed convex optimization