> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0223_rectangle_area/slt.md).

# 思路1

先把交叉部分的左右上下四个边的值算出来。在用两个矩形面积和和减去交叉部分的和。注意为了避免溢出，我们先减后加。

有一组数据是(0, 0, 50000, 40000, 0, 0, 50000, 40000)

50000 \* 40000 = 2,000,000,000

而32位int上限是2,147,483,647

如果两个矩形面积直接相加的话就溢出了
