def rectAt(cen, size):
    """Returns a rectangle of the given `size` centered at the given location.
    The coordinates are inclusive of borders."""
    x, y = cen[:2]
    w, h = size[:2]
    return [x-w//2, y-h//2, x-w//2+w-1, y-h//2+h-1]