code: def print_objective(x):
      
      value = 0
      for minp, maxp in rectangles:
          x_proj = np.minimum(np.maximum(x, minp), maxp)
          value += (x - x_proj).norm()
      print('Point = [{:.4f}, {:.4f}], Value = {:.4f}'.format(x[0], x[1], value))
docs: Calculate the objective value and prints it.