Classic
Clean & simple
Crystal
Glassmorphism + Neon
Cyberpunk
Neon glitch art
🚫
违规Action检测
禁止Use右键菜单
⚠️ 此Action已被系统记录
1

Total Area

📝 Solutions 🔵 仅限 C++
Problems Description
<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>
Input格式
<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>
Output格式
<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>
Sample
Sample Input 1
1 0 0 2 2 2 2 1 1
Sample Output 1
4
Submit Code
请先Login后Submit

🤖 AI 解题助手

OpenRouter
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这problems题,可以帮你points析思路、提供Code示例。
🔓 完全Free · 无需消耗 Token