report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Point coverage - MarisaOJ: Marisa Online Judge

Point coverage

Time limit: 1000 ms
Memory limit: 256 MB
There are $n$ rectangles in the Descartes plane. $i^{th}$ has its lower left corner at $(x_1, y_1)$ and its upper right corner at $(x_2, y_2)$. How many points on the plane are covered by at least 1 rectangle? ### Input - The first line contains an integer $n$. - Next $n$ lines, each line contains 4 integers $x_1, y_1, x_2, y_2$. ### Output - An integer is the number of points covered by at least 1 rectangle. ### Constraints - $1 \le n \le 100$. - $1 \le x_1, y_1, x_2, y_2 \le 100$. ### Example Input: ``` 2 1 1 2 2 1 1 3 3 ``` Output: ``` 9 ```
Two dimensional array
Pascal's triangle
Column sum
Appearance
Diagonal sum
Point coverage
Swap operation
Spiral matrix
Word search
Matrix rotation
Matrix Zigzag
Topic
Basic
Rating 800
Solution (1) Solution