Submit solution
Points:
0.23 (partial)
Time limit:
0.38s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem source:
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch
Trên mặt phẳng toạ độ người ta vẽ ra ~N~ hình chữ nhật. Hãy tính diện tích che phủ bởi ~N~ hình chữ nhật này, biết rằng ~N~ hình chữ nhật này song song với ~2~ trục ~Ox~ và ~Oy~.
Input
Dòng ~1~: số nguyên ~N~ (~1 \leq N \leq 10000~).
~N~ dòng tiếp theo, mỗi dòng gồm ~4~ số nguyên ~x_1~, ~y_1~, ~x_2~, ~y_2~ tương ứng là toạ độ góc trái dưới và góc phải trên của hình chữ nhật thứ ~i~. (~0 \leq~ ~x_1~ ~\leq~ ~x_2~ ~\leq 30000~, ~0 \leq~ ~y_1~ ~\leq~ ~y_2~ ~\leq 30000~).
Output
Gồm ~1~ dòng ghi ra diện tích phủ bởi ~N~ hình chữ nhật
Sample Input
2
10 10 20 20
15 15 25 30
Sample Output
225
Comments
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.