A. King Escape
Approach
To check if the king can reach the target, we need to ensure that both the king and the target lie in the same quadrant relative to the black queen. We can determine this by comparing the signs of the x and y coordinates of the king and the target with respect to the queen. If they have the same signs for both coordinates, then they are in the same quadrant and the king can reach the target.
Code
dimension = int(input())
ax, ay = map(int, input().split())
bx, by = map(int, input().split())
cx, cy = map(int, input().split())
# Check if king and target are in the same quadrant
if (bx-ax) * (cx-ax) > 0 and (by-ay) * (cy-ay) > 0:
print("YES")
else:
print("NO")



