, Violation Code

Source: Internet
Author: User

, Violation Code

How many desktops are there?

Time Limit: 3000 MS Memory Limit: 365536 K
Total Submit: 23 Accepted: 15

Description

Zjahstu insists on computer-related thinking and coding every day.
"The elderly ACM" becomes a cool man, referred to as "the old ox. Because every application process
The window in sequence can be regarded as a rectangle. overlapping windows are too common.
Think: How much area is not covered? Programming help.
Let's explain: set the size of desktop D to M * N, 120 = standard (X, Y) and its length to L high H (unit: pixel ), your task is D-Wi.
Product, gray indicates 800*600 of the desktop, Red blue indicates the window, and the remaining area is
240000 pixels (do not consider the status bar)

Input

The first line is the number of test cases m, followed by the m group of test data
Each group of test data has two integers indicating the desktop size, followed by k indicating that there are k program windows W
Each window is represented by four integers, indicating the coordinates X, Y, length L, and height H in the upper left corner.

Output

The output is the desktop area not covered by the window.

Sample Input

2800 600 21 1 400 300401 301 800 6001024 768 11 1 1024 768

Sample Output

2400000

Source

Ahstu @ ICPC02


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. Welcome to share your nice codes!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.