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
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions

This Question is listed twice
This Question is listed twice : DPC207,DPC107 :p
This one has a better time
This one has a better time limit
Please help. DP207 and DP107
Please help.
DP207 and DP107 are the same (except for the time limit)
But when I submit the code in DP107 it gives me run time error
and the same code in DP207 gives me correct answer
Why is it so?
yes i also have the same
yes i also have the same problem as Neil
the sample input IS the
I am impressed