#C7354. Rectangle Fitting Problem
Rectangle Fitting Problem
Rectangle Fitting Problem
You are given two axis-aligned rectangles. The first rectangle is defined by the bottom-left corner (x1, y1) and the top-right corner (x2, y2). The second rectangle is defined by the bottom-left corner (X1, Y1) and the top-right corner (X2, Y2).
Your task is to determine whether the first rectangle completely fits inside the second rectangle. In mathematical terms, the first rectangle fits inside the second if and only if $$X_{1} \le x_{1} \quad \text{and} \quad x_{2} \le X_{2} \quad \text{and} \quad Y_{1} \le y_{1} \quad \text{and} \quad y_{2} \le Y_{2}.$$
Note that touching the border is considered as fitting.
inputFormat
The input is read from stdin and consists of eight space-separated integers: x1 y1 x2 y2 X1 Y1 X2 Y2
.
outputFormat
Output to stdout a single word: Yes
if the first rectangle fits inside the second rectangle, otherwise No
.
1 1 3 3 0 0 4 4
Yes