WindowsProblem code: DPC107 |
When displaying a collection of rectangular windows, a critical step is determining whether two windows overlap, and, if so, where on the screen the overlapping region lies. Write a program to perform this function. Your program will accept as input the coordinates of two rectangular windows. If the windows do not overlap, your program should produce a message to the effect. If they do overlap, you should compute the coordinates of the overlapping region (which must itself be a rectangle).
All coordinates are expressed in "pixel numbers", integer values ranging from 0 to 9999. A rectangle will be described by two pairs of (X, Y) coordinates. The first pair gives the coordinates of the lower left hand corner (XLL, YLL). The second pair gives the coordinates of the upper right hand coordinates (XUR, YUR). You are guaranteed that XLL<XUR and YLL<YUR.
Input
The first line will have a number N (0<N<=100) with the number of test cases. Each test case will consists of two lines each containing four numbers. The first line contains the integer numbers XLL, YLL, XUR and YUR for the first window. The second contains the same numbers for the second window.
Output
For each test case, if the two window do no overlap, print the
Message "No Overlap". If the two windows do overlap, print 4 integer numbers giving the XLL, YLL, XUR and YUR for the region of overlap. Note that two windows that share a common edge but have no other point in common are considered to have "No Overlap".
Sample Input
2
0 20 100 120
80 0 500 60
10 10 20 20
30 30 40 40
Sample Output
80 20 100 60
No Overlap
| Author: | rushikesh30 |
| Date Added: | 25-02-2010 |
| Time Limit: | 10 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, C99 strict, CLOJ, CPP 4.0.0-8, CPP 4.3.2, CS2, F#, GO, JAVA, PERL6, PYTH 3.1.2, TEXT |
Comments

Fetching successful submissions

hahahah ....so
hahahah ....so easy........why do u think that ppl dont know even this much.....hahahaha
I asked the Question Setters
I asked the Question Setters to set very Easy Questions. This contest is not meant to pick up the best, it aims at Encouraging the Beginners.
Check out the Next Contest Mr. Hahahaha and though there'll be 3 easy questions again to Encourage the Beginners, try solving the Next 7.
And ya, first solve all 7, there's one particular problem that can JUDGE the Caliber of Coders.
I am the Organizer. This
I am the Organizer.
This contest is a part of Tech-Days2010 and Microsoft DreamSpark Yatra organized by Microsoft Student Partner India Team and supported by Microsoft Academia Team.
Our UnderConstruction WebSite is at www.tech-days2010.com
and to register visit http://bit.ly/RegisterDevCon
Moreover when you are
Moreover when you are registering at http://bit.ly/RegisterDevCon , you need not pay if you are attending only online Events. But registration is compulsory to get prizes and Certis.
Special Thanks to Rushikesh
Special Thanks to
Rushikesh Deshpande (ISMU Dhanbad); Shahzor Khan(BIT Mesra); Kunal Jain(IIIT Hyderabad); Gourab Mitra(MSP BIT Mesra); Subhradip Saha(MSTC BIT Mesra)
@ALL Please mail your
@ALL
Please mail your CodeChef ID, your name, your Institutions Name, Your Address(Where you want Posters, Certis, Goodies to be delivered, (No. of deliveries will depend on our budget)) to dreamsparkyatra@gmail.com For Updates follow http://twitter.com/dreamsparkyatra .
Happy Holi and Happy Coding!
@All Check out the
@All
Check out the DreamSpark Professional Programming Contest #2 on 13th March 18:00 hours IST. We will send Posters to Participants by Post to promote the Contest Series. We'll also try to Send Participation E-Certis.