经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

Total Area

📝 题解 🔵 仅限 C++
题目描述
<p><span style="font-size: large;"><span style="font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; There are two rectangles on the same plane and their sides are parallel to x-axis and y-axis. You are given the coordinates of two points on the diagonals of each rectangle. Now you need to count the total area of these two rectangles. Please don't count the area of the intersected part of two rectangles twice.<br /> </span></span></p>
输入格式
<p><span style="font-size: large;"><span style="font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The first line of the input file contains one integer T which is the number of test cases following. Each test case contains 8 integers which are the coordinates of four points which are metioned before. These 8 numbers are x1,y1,x3,y3,x2,y2,x4,y4. (x1,y1) and (x2,y2) are the points on the first retangle. (x3,y3) and (x4,y4) are the points on the second retangle. <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; What's more, -1000000&lt;= xi, yi(1&lt;=i&lt;=4) &lt;= 1000000.<br /> </span></span></p>
输出格式
<p><span style="font-size: large;"><span style="font-family: Arial;">&nbsp;&nbsp; &nbsp; Output the total area of two rectangles for each case in a single line.<br /> </span></span></p>
样例
样例输入 1
1 0 0 2 2 2 2 1 1
样例输出 1
4
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用