Near-optimal recovery of linear and N-convex functions on unions of convex sets. (7th May 2019)