WindowsProblem code: DPC207 |
All submissions for this problem are available.
Windows
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: | 10-03-2010 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments

Fetching successful submissions

Please register at
Please register at http://bit.ly/DSPPC2_Register to claim prizes and certificates.
Admin: The aim of this
Admin: The aim of this contest is to promote programming and not to adjudge the best programmers. We request the participants to maintain a Healthy Competition. Any mal-practices if found will lead to Disqualification from the Series. If any such codes have been submitted consider submitting fresh codes.
Admin: The aim of this
Admin: The aim of this contest is to promote programming and not to adjudge the best programmers. We request the participants to maintain a Healthy Competition. Any mal-practices if found will lead to Disqualification from the Series. If any such codes have been submitted consider submitting fresh codes.
I am getting RTE for my
I am getting RTE for my python program.
Submission ID: 210963. Can you please check if the input follows the format.
The CodeChef Rankings are not
The CodeChef Rankings are not accepted Directly. Some Mal-Practices have been observed and Strict action would be taken.