UVA Solution 460 – Overlapping Rectangles – Solution in C,C++

UVA Onilne Judge Solution UVA-Volume 4

UVA Solution 460 – Overlapping Rectangles – Solution in C,C++

UVA Online Judge Solution  460 – Overlapping Rectangles | Volume 4
UVA Problem Link –  460 – Overlapping Rectangles

Problem Name:  460 – Overlapping Rectangles solution
Problem Number : UVA –  460 – Overlapping Rectangles solution
Online Judge : UVA Online Judge Solution
Volume: 4
Solution Language : C,C plus plus

UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list

UVA Solution  460 – Overlapping Rectangles Code in C/CPP:

#include <stdio.h>
#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
typedef struct {
int
x, y;
}
Point;
int
main() {
int
t;
scanf("%d", &t);
while
(t--) {
Point a, b, c, d;
int
i, j, k, l;
scanf("%d %d %d %d", &a.x, &a.y, &b.x, &b.y);
scanf("%d %d %d %d", &c.x, &c.y, &d.x, &d.y);
i = max(a.x, c.x);
j = max(a.y, c.y);
k = min(b.x, d.x);
l = min(b.y, d.y);
if
(i >= k || j >= l)
puts("No Overlap");
else

printf("%d %d %d %dn", i, j, k, l);

if
(t)
puts("");
}

return
0;
}

Tags: UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list, UVA 460 code in C, UVA 460 – Overlapping Rectangles  code in C++, UVA solution in C, UVA 460 – Overlapping Rectangles solution

Leave a Reply

Your email address will not be published. Required fields are marked *