def square_metric(p1, p2):
    """Square metric: the maximum of the absolute values of the coordinates
  of the point p2 - p1.
  When square_metric(p1, p2) <= x, the two 2D points p1, p2 lie inside
  boundaries of a square of side x."""
    return max(abs(p2[0] - p1[0]), abs(p2[1] - p1[1]))
