문제 설명
Raya was fishing when she found seaweed floating on the surface. (This tells us that she was fishing in the ocean.)
But suddenly, the seaweed had a beautiful and harmonious color. When she looked closely, she saw that there were two seaweeds overlapping in that area.
Raya was curious about the area of the harmonious area created by the two seaweeds overlapping.
Seaweed is a square shape parallel to the x-axis and y-axis on a 2D plane, and the two vertices connected diagonally are expressed as a total of four integers. (x and y-coordinate of the first vertex, x and y-coordinate of the second vertex in that order)
입력 설명
The input consists of several test cases. The first line contains the number of test cases, T.
Starting from the second line, each line contains eight integers (greater than -10,000 and less than 10,000) representing two seaweed sheets, one test case. The first four integers represent the first seaweed sheet, and the last four integers represent the second seaweed sheet.
출력 설명
Print the answer to each test case, one per line.
2
1 1 3 3 2 2 4 4
1 1 2 2 3 3 4 4