Problem Statement
You have a two-dimensional plane, initially the plane is white. On this two-dimensional plane you will perform queries on this plane:
- Each query is given , and
- Colour the rectangle to At the end of all queries, determine the total area which is black.
Input Format
Your first line will contain a single integer . Your next lines will contain three integers each, representing , and respectively.
Output Format
Output the total number of area that is coloured black after performing all queries.
Constraints
Sample Cases
Input 1
3
0 1 1
0 3 3
2 4 2
Output 1
11
Input 2
2
0 100000 100000
1 99999 100001
Output 2
10000099998
Template
n = int(input())
rectangles = [tuple(map(int, input().split())) for _ in range(n)]
# print your output
Comments