Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Mathematics and Computer Science
Overlapping Rectangles
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 34, Accepted users: 31
Problem 10012 : No special judgement
Problem description
  Given N rectangular areas in the plane, we try to find whether it exists overlapping area of N rectangles, and if so, where is the overlapping region?

Input
  The input for this problem will consist of one or more sets of data in free format. Each set will begin with an integer N < 1000 giving a number of rectangles to follow. Next will follow N rectangles, each specified as four integers, Xl, Yl, Xr, and Yr. These specify coordinates for the lower left corner (Xl, Yl) and upper right corner (Xr, Yr) of the rectangle (whose sides are always aligned parallel to the x and y axes). Coordinates may be any integer in the range -231 to 231-1.The last set of input is followed by a single integer 0.

Output
  The output will consist of one line for each set, giving the number of the set and either the lower left and upper right corners of the overlapping rectangle formed by the input rectangles, or a message ˇ°No overlapˇ± that the area covered do not exist. Use the format shown in the example.

Sample Input
3
0 0 3 3 0 1 4 4
1 0 5 2
2
-1 -1 1 3 0 -1 4 1
4
0 0 2 4 1 0 5 1
1 3 5 4 4 0 5 4
0
Sample Output
Set 1: (1,1), (3,2)
Set 2: (0,-1), (1,1)
Set 3: No overlap
Problem Source
  HNU Contest 

Submit   Discuss   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:297 today,10600131 total, since 2010-05-07