Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- line1 = list(map(int, input().split()))
- line2 = list(map(int, input().split()))
- square1 = {
- "a": (line1[0], line1[1]),
- "b": (line1[0] + line1[2], line1[1]),
- "c": (line1[0], line1[1] - line1[3]),
- "d": (line1[0] + line1[2], line1[1] - line1[3])
- }
- square2 = {
- "a": (line2[0], line2[1]),
- "b": (line2[0] + line2[2], line2[1]),
- "c": (line2[0], line2[1] - line2[3]),
- "d": (line2[0] + line2[2], line2[1] - line2[3])
- }
- maxx1 = square1["b"][0]
- minx1 = square1["a"][0]
- maxy1 = square1["a"][1]
- miny1 = square1["c"][1]
- maxx2 = square2["b"][0]
- minx2 = square2["a"][0]
- maxy2 = square2["a"][1]
- miny2 = square2["c"][1]
- if maxx1 > maxx2 or maxy1 > maxy2:
- for x, y in square2.values():
- print(minx1, x, maxx1, miny1, y, maxy1)
- if minx1 <= x <= maxx1 or miny1 <= y <= maxy1:
- print("YES")
- break
- else:
- print("NO")
- else:
- for x, y in square1.values():
- print(minx2, x, maxx2, miny2, y, maxy2)
- if minx2 <= x <= maxx2 or miny2 <= y <= maxy2:
- print("YES")
- break
- else:
- print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement