F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Books

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 329    Accepted Submission(s): 43


Problem Description


AliĄ¯s room is full of books and he has never come up with a good way to arrange them. He just put them on the desk. But sometimes the books became unstable due to the gravity, and some might slide off the desk. He found it very annoying and decided to use a new method to put his books.
He bought some magic clips to stabilize the books. Once he put a book onto the desk, he will check if the book is steady. If it is, then he will use a clip to stabilize it and it will never slide or flip. If not, he will just pick up the book and throw it onto the floor and deal with it later.
But as he began to use the new method, he found it hard to decide whether a book is steady when put it on the desk. So he needs your help to determine that.
Assume that every book has the same thickness.
A book is steady means it will stay unmoved and horizontal even if given a small force.
 

Input
The input consists several testcases.
The first line contains the number of books N (1 <= N <= 2000).
The following N lines each contains four integers, x1,y1,x2,y2 (-103 <= x1, y1, x2, y2 <= 103), means that the i-th book is placed with lower-left-corner placed at x1,y1 and upper-right-corner placed at x2,y2 (if you look down from above). The bookĄ¯s edge is always paralleled with the deskĄ¯s edge.
 

Output
Print one integer, the number of books that are remained on the desk.
 

Sample Input
3 0 0 2 2 -1 0 3 1 2 0 3 2
 

Sample Output
2
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-16 19:05:34, Gzip enabled