|
|||
Animal Zones
Gloria the Hippo and Melman the Giraffe are shocked to find they have been asked to design a new zoo, where each animal species will live in its own rectangular animal zone. They decide to have different companies design each animal zone. All companies submit coordinates for their animal zone, and construction begins when zones do not overlap. Gloria and Melman hope this takes a very long time to work out. You have been hired to write a program tha analyzes zone boundaries and reports to Gloria and Melman whether any animal zones overlap. Two zones are considered to overlap if one contains part of the other, if they share a portion of a common side, or if they share a common corner. Each company will submit the (x, y) coordinates of the lower left and top right corners of their animal zone, where (0, 0) indicates the bottom left corner of the zoo. You may assume that all zones fit within a 20 by 20 area (coordinates range between 0…19). Input SpecificationThe input will consist of a line containing the number of animal zones, followed by one line per zone in the format x1 y1 x2 y2, where (x1, y1) is the lower left-hand corner of the rectangle, and (x2, y2) is the upper right-hand corner of the rectangle. Output Specification
The output will be “ Sample Input 1
Output for Sample Input 1
Sample Input 2
Output for Sample Input 2
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |