题解 | #二维数组操作#
二维数组操作
https://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4
while True:
try:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
d = list(map(int,input().split()))
e = list(map(int,input().split()))
size_r,size_c = a[0],a[1]
x1,y1,x2,y2 = b[0],b[1],b[2],b[3]
r = c[0]
c = d[0]
x,y = e[0],e[1]
# check q1
if size_r<=9 and size_r>=0 and size_c<=9 and size_c>=0:
print(0)
#check q2
print(0) if x1 in range(0,size_r) and x2 in range(0,size_r) and y1 in range(0,size_c) and y2 in range(0,size_c) else print(-1)
#check q3
print(0) if r in range(0,size_r) and size_r<9 else print(-1)
#check q4
print(0) if c in range(0,size_c) and size_c<9 else print(-1)
#check q5
print(0) if x in range(0,size_r) and y in range(0,size_c) else print(-1)
else:
print(-1)
print(-1)
print(-1)
print(-1)
print(-1)
except:
break