import torch


def area(left_top: torch.Tensor, right_bottom: torch.Tensor):
    """Compute area of rectangles given two corners.

    :param left_top: (N, 2) left top corner
    :param right_bottom: (N, 2) right bottom corner
    :return: (N) area of the rectangle
    """
    hw = torch.clamp(right_bottom - left_top, min=0.0)
    return hw[..., 0] * hw[..., 1]