Problem:


Score : 200 points

Problem Statement

Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.

The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.

One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.

If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.

X < Z \leq Y

x_1, x_2, ..., x_N < Z

y_1, y_2, ..., y_M \geq Z

Determine if war will break out.

Constraints

All values in input are integers.

1 \leq N, M \leq 100

-100 \leq X < Y \leq 100

-100 \leq x_i, y_i \leq 100

x_1, x_2, ..., x_N \neq X

x_i are all different.

y_1, y_2, ..., y_M \neq Y

y_i are all different.

Input

Input is given from Standard Input in the following format:

N M X Y
x_1 x_2 ... x_N
y_1 y_2 ... y_M

Output

If war will break out, print War; otherwise, print No War.

Sample Input 1

3 2 10 20
8 15 13
16 22

Sample Output 1

No War

The choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.

X = 10 < 16 \leq 20 = Y

8, 15, 13 < 16

16, 22 \geq 16

Sample Input 2

4 2 -48 -1
-20 -35 -91 -23
-22 66

Sample Output 2

War

Sample Input 3

5 3 6 8
-10 3 1 5 -100
100 6 14

Sample Output 3

War



Sample input:
3 2 10 20
8 15 13
16 22


Sample output:
No War

Submission status: Wrong Answer

Solution code:
n, m, a, b = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

if max(x) < min(y) and a < b:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = max(list(map(int,input().split())))
b = max(list(map(int,input().split())))
ans = "War"
for i in range(x+1,y):
    if i>a and i<=b:
        ans = "No War"
print(ans)

Submission status: Wrong Answer

Solution code:
n,m,x,y = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
max_x = max(a)
max_y = max(b)
max_x = max(max_x,x)
max_y = max(max_y,y)
 
if max_x < max_y:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
xs.append(x)
ys.append(y)
if max(xs) < min(ys):
    print("N0 War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if max(x) <= min(y):
  if X < min(y) <= Y:
    print("No War")
    exit()
print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
if max(X)+1 < min(Y):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
n,m,a,b = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[-1]<y[0]:
    for i in range(x[-1]+1,y[0]+1):
        if a<i<b:
            print("No War")
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x_lis = list(map(int,input().split()))
y_lis = list(map(int,input().split()))

x_max = max(x_lis)
y_min = min(y_lis)

ans = "War"
for Z in range(X,Y+1):
  if x_max < Z <= y_min:
    ans = "No War"
    
print(ans)

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = sorted(x, reverse=False)[-1]
y = sorted(y, reverse=False)[0]
flg = 'War'
if x < x+1 <= y:
    if x+1 > X:
        flg = 'No War'

print(flg)

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.sort()
y.sort()
if x[n-1]<y[0]:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
a, b = [list(map(int, input().split())) for i in range(2)]

for i in range(x + 1, y + 1):
  if all(j < i for j in a) and all(k >= i for k in b):
    print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = sorted(map(int,input().split()))
b = sorted(map(int,input().split()))
a.append(x)
b.append(y)
if a[-1]<b[0]:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = sorted(map(int,input().split()))
b = sorted(map(int,input().split()))
a.append(x)
b.append(y)
if a[-1]<=b[0]:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = sorted(map(int,input().split()))
b = sorted(map(int,input().split()))
if x<y and a[-1]<b[0]:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y=list(map(int, input().split()))
xc=list(map(int, input().split()))
yc=list(map(int, input().split()))
xc.sort()
yc.sort()
if xc[-1]>=yc[0]:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
lsx = list(map(int,input().split()))+[X]
lsy = list(map(int,input().split()))+[Y]
if max(lsx) < min(lsy):
    print('No war')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x=max(list(map(int,input().split())))
y=min(list(map(int,input().split())))

for z in range(X+1,Y+1):
    if x<=z<=y:
        print("No War")
        exit()
print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ans="War"
x.append(X)
y.append(Y)
if max(x)<min(y):
        ans="NO War"
print(ans)

Submission status: Wrong Answer

Solution code:
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

xmax = max(x)
ymin = min(y)

for i in range(xmax,ymin+1):
    if X<i<Y:
        print("No War")
        exit()
    
print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
if (X < Y)&(max(x) < min(y))&(max(x) < Y <min(y)):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))

flag = True
if Y <= X:
    flag = False

if y[0] <= x[-1]:
    flag = False

if flag:
    if X in y:
        flag = False
    
    if Y in x:
        flag = False
    

if flag:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))

flag = True
if Y <= X:
    flag = False

if y[0] <= x[-1]:
    flag = False

if flag:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))

flag = True

if y[0] <= x[-1]:
    flag = False

if flag:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))

flag = True

if y[0] < x[-1]:
    flag = False

if flag:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))

flag = True

if y[0] < x[-1]:
    flag = False

if flag:
    if X in y:
        flag = False
    if Y in x:
        flag = False

if flag:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
X_list = list(map(int, input().split()))
Y_list = list(map(int, input().split()))
maxX = max(X_list)
minY = min(Y_list)
if minY > maxX and maxX != Y and minY != X:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
 
x.sort(reverse=True)
y.sort()
 
 
flag=0
for i in range(X+1,Y+1):
  if x[0]<=i and y[0]>i:
    flag=1
    break
  
 
  else:
    flag=0
    
if flag==1:
  print('No War')
  
else:
  print('War')

Submission status: Wrong Answer

Solution code:
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))

x.sort(reverse=True)
y.sort()

if x[0]<=Y and y[0]>X:
  print('No War')
  
else:
  print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
x1=list(map(int,input().split()))
y1=list(map(int,input().split()))
z=[i for i in range(max(x1),min(y1)+1)]
for i in z:
  if x<i<=y:
    print('No War')
    break
else:
  print('War')

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	n,m,x,y = map(int,input().split())
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))
 
	x_max = max(X)
	y_min = min(Y)

	for Z in range(x+1,y+1):
		if x_max < Z <= y_min:
			flg = True
			print("No war")
			exit()
	print("War")

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	n,m,x,y = map(int,input().split())
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))
 
	x_max = max(X)
	y_min = min(Y)

	flg = False
	for Z in range(x+1,y+1):
		if x_max < Z and Z <= y_min:
			flg = True
			break

	if flg :
		print("No war")
	else:
		print("War")

Submission status: Wrong Answer

Solution code:

if __name__ == '__main__':
	n,m,x,y = map(int,input().split())
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))

	x_max = max(X)
	y_min = min(Y)

	for Z in range(x+1,y+1):
		if x_max < Z <= y_min:
			print("No war")
			break
	else:
		print("War")

Submission status: Wrong Answer

Solution code:

if __name__ == '__main__':
	n,m,x,y = map(int,input().split())
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))

	x_max = max(X)
	y_min = min(Y)

	for Z in range(x,y):
		if x_max < Z <= y_min:
			print("No war")
			break
	else:
		print("War")

Submission status: Wrong Answer

Solution code:

if __name__ == '__main__':
	n,m,x,y = map(int,input().split())
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))
	X.sort()
	Y.sort()

	flg = False
	#xの場所がYのFROM-に入っていないこと
	if (Y[0] <= x):
		flg = True
	#yの場所がXのFROM-に入っていないこと
	elif (y <= X[n-1]):
		flg = True
	#Xの右端とYの左端が交わらないこと
	elif (X[n-1] > Y[0]):
		flg = True

	if flg:
		print("War")
	else:
		print("No War")

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	n,m,x,y = map(int,input().split())
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))
	X.sort()
	Y.sort()

	flg = False
	#xの場所がYのFROM-TOに入っていないこと
	if (Y[0] <= x <= Y[m-1]):
		flg = True
	#yの場所がXのFROM-TOにはいっていないこと
	elif (X[0] <= y <= X[n-1]):
		flg = True
	#Xの右端とYの左端が交わらないこと
	elif (X[n-1] > Y[0]):
		flg = True

	if flg:
		print("War")
	else:
		print("No War")

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for i in range(X+1,Y+1):
  if max(x)<i and min(y)>=i:
    print("No War")
    print(i)
    sys.exit()
print("War")

Submission status: Wrong Answer

Solution code:
MM = input().split()
N = int(MM[0])
M = int(MM[1])
X = int(MM[2])
Y = int(MM[3])
xx = input().split()
yy = input().split()
xxx =[]
yyy =[]
for i in xx:
  xxx.append(int(i))
for i in yy:
  yyy.append(int(i))
xxx.sort()
yyy.sort()
count =0
for i in range(X+1,Y+1):
  if xxx[-1] < i and yyy[0] >= i:
    count +=1
    print(i)
if count == 0:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
MM = input().split()
N = int(MM[0])
M = int(MM[1])
X = int(MM[2])
Y = int(MM[3])
xx = input().split()
yy = input().split()
xxx =[]
yyy =[]
for i in xx:
  xxx.append(int(i))
for i in yy:
  yyy.append(int(i))
xxx.sort()
yyy.sort()
count =0
for i in range(X,Y+1):
  if xxx[-1] < i and yyy[0] >= i:
    count +=1
if count == 0:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
n = [list(map(int, input().split())) for i in range(2)]
a = sorted(n[0], reverse=True)[0]
b = sorted(n[1])[0]
print(a)
print(b)
war = 0
for i in range(x[2]+1, x[3]):
  if (i > a) and (i <= b):
    war = 1
if war == 1:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())

x = list(map(int,input().split()))
y = list(map(int,input().split()))
ans = 'War'
for i in range(-100,101):
    if X < i <= Y and max(x)<i and max(y)>=i:
        ans = 'No War'
        break
print(ans)

Submission status: Wrong Answer

Solution code:
i=lambda:map(int,input().split());n,m,x,y=i();print("No"*(max(x,max(i()))<min(min(i()),y))+'War')

Submission status: Wrong Answer

Solution code:
i=lambda:map(int,input().split());*n,=i();print("No "*(max(i())<min(i()))+'War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
ListX = list(map(int, input().split()))
ListY = list(map(int, input().split()))
ListX.sort()
ListX.sort()
threX = max(X,ListX[N-1])
threY = min(Y,ListY[0])
Z = threX+1
if threY >= Z:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m, x, y = map(int, readline().split())
lx = list(map(int, readline().split()))
ly = list(map(int, readline().split()))

if max(lx) >= min(ly):
    print('War')
    exit()
for i in range(max(lx), min(ly) + 1):
    if x < i <= y:
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y = map(int,input().split())
x =  list(map(int,input().split()))
y =  list(map(int,input().split()))

for Z in range(X+1,Y+1):
    if max(x) >= Z and Z <= min(y):
        print("No War")
        sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y = map(int,input().split())
x =  list(map(int,input().split()))
y =  list(map(int,input().split()))
#print(x)
#print(max(x),min(y))
for Z in range(X+1,Y+1):
    if max(x) < min(y):
        if max(x) >= Z and Z <= min(y):
            print("No War")
            sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y = map(int,input().split())
x =  list(map(int,input().split()))
y =  list(map(int,input().split()))
#print(x)
#print(max(x),min(y))

if max(x) <= min(y):
    if max(x) >= X:
        print("No War")
        sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y = map(int,input().split())
x =  list(map(int,input().split()))
y =  list(map(int,input().split()))
#print(x)
#print(max(x),min(y))

if max(x) < min(y):
    if max(x) >= X or Y <= min(y):
        print("No War")
        sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y = map(int,input().split())
x =  list(map(int,input().split()))
y =  list(map(int,input().split()))
#print(x)
#print(max(x),min(y))

if max(x) < min(y):
    if max(x) >= X:
        print("No War")
        sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y = map(int,input().split())
x =  list(map(int,input().split()))
y =  list(map(int,input().split()))
#print(x)
#print(max(x),min(y))

if max(x) < min(y):
    if max(x) > X:
        print("No War")
        sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
import math
def main():
  n,m,x,y = list(map(int,input().split()))
  xv = list(map(int,input().split()))
  yv = list(map(int,input().split()))
  flg=0
  if max(xv)<=min(yv):
    for i in range(max(xv),min(yv)+1):
      if(x < i )and(i <= y):
        flg=1
        break
  if flg==1:
    print("No War")
  else:
    print("War")

main()

Submission status: Wrong Answer

Solution code:
import math
def main():
  n,m,x,y = list(map(int,input().split()))
  xv = list(map(int,input().split()))
  yv = list(map(int,input().split()))
  flg=0
  if max(xv)<=min(yv):
    for i in range(max(xv),min(yv)):
      if(x <= i )and(i <= y):
        flg=1
        break
  if flg==1:
    print("No War")
  else:
    print("War")

main()

Submission status: Wrong Answer

Solution code:
import math
def main():
  n,m,x,y = list(map(int,input().split()))
  xv = list(map(int,input().split()))
  yv = list(map(int,input().split()))
  if max(xv)<=min(yv) and x <= max(xv) and min(yv) <= y:
    print("No War")
  else:
    print("War")

main()

Submission status: Wrong Answer

Solution code:
import math
def main():
  n,m,x,y = list(map(int,input().split()))
  xv = list(map(int,input().split()))
  yv = list(map(int,input().split()))
  if max(xv)<=min(yv) and x <= max(xv):
    print("No War")
  else:
    print("War")

  
main()

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xx=list(map(int,input().split()))
yy=list(map(int,input().split()))
mx=max(xx)
my=min(yy)
if mx>my:
  print("War")
elif mx>=y or x>=my:
  print("War")
else:
  print("No War")

Submission status: Wrong Answer

Solution code:
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.append(X)
y.append(Y)
if max(x)<=min(y):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
import sys
N,M,X,Y = map(int,input().split())
array_x = list(map(int,input().split()))
array_y = list(map(int,input().split()))

if not ( 1 <= N <= 100 and 1 <= M <= 100 ): sys.exit()
if not ( -100 <= X <= 100 and -100 <= Y <= 100 ): sys.exit()
for I in array_x:
    if not ( -100 <= I <= 100 and array_x.count(I) == 1 and I != X): sys.exit()
for J in array_y:
    if not ( -100 <= J <= 100 and array_y.count(J) == 1 and J != Y): sys.exit()

if min(array_y) - max(array_x) >= 1:
    for K in range(max(array_x),min(array_y)+1):
        if X < K <= Y and max(array_x) < K and min(array_y) >= K:
            print('No War')
            sys.exit()
if min(array_x) - max(array_y) >= 1:
    for L in range(max(array_y),min(array_x)+1):
        if X < L <= Y and max(array_y) < L and min(array_x) >= L:
            print('No War')
            sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.append(X)
# y.append(Y)
x.sort()
y.sort()

if x[-1] >= y[0]:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.append(X)
y.append(Y)
x.sort()
y.sort()

if x[-1] >= y[0]:
    print("War")
else:
    print("NO War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.append(X)
x.sort()
y.sort()

if x[-1] >= y[0]:
    print("War")
else:
    print("NO War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
xl.sort(reverse = True)
yl.sort()

if xl[0] < yl[0]:
    p = yl[0]
    while p > x:
        if p <= y:
            print('No War')
            exit(0)
        p -= 1
    print('War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
xl.sort(reverse = True)
yl.sort()

if xl[0] < yl[0]:
    p = yl[0]
    while p > x:
        if x < p and p <= y:
            print('No War')
            exit(0)
        p -= 1
    print('War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
xl.sort(reverse = True)
yl.sort()

if xl[0] < x and yl[0] >= y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

_ = rl()
maxx = max(rm())
miny = min(rm())
if maxx >= miny-1:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

_ = rl()
maxx = max(rm())
miny = min(rm())
if maxx >= miny:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
n,m,X,Y=sorted(map(int,input().split()))
x=max(X,max(map(int,input().split())))
y=min(Y,min(map(int,input().split())))
print("No War" if x<y else "War")

Submission status: Wrong Answer

Solution code:
def main():
    n,m,X,Y=sorted(map(int,input().split()))
    x=max([X]+list(map(int,input().split())))
    y=min([Y]+list(map(int,input().split())))
    print("No War" if x<y else "War")
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n,m,X,Y=sorted(map(int,input().split()))
x=max([X]+list(map(int,input().split())))
y=min([Y]+list(map(int,input().split())))
print(["War","No War"][x < y])

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort()
y.sort()
if x[n - 1] < y[0] and X <= y[0] and x[n - 1] <= Y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort()
y.sort()
if x[n - 1] <= y[0] and X <= y[0] and x[n - 1] <= Y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort()
y.sort()
if x[n - 1] <= y[0] and X < y[0] and x[n - 1] < Y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort(reverse = True)
b.sort()

if b[0] - a[0] < 1:
    print('War')
else:
    if x <= b[0] or y > b[0]:
        print('War')
    elif x >= a[0] or y < a[0]:
        print('War')
    else:
        print('No War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort(reverse = True)
b.sort()

if b[0] - a[0] < 1:
    print('War')
else:
    if x == b[0] or y == b[0]:
        print('War')
    elif x == a[0] or y == a[0]:
        print('War')
    else:
        print('No War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort(reverse = True)
b.sort()

if b[0] - a[0] < 1:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort(reverse = True)
b.sort()

if b[0] - a[0] < 2:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x = [X] + list(map(int,input().split()))
y = [Y] + list(map(int,input().split()))

if max(x) >= min(y):
    print("War")
else:
    print("NO War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))
print([x]+xx)
xxx = max(xx + [x])
yyy = min(yy + [y])
if xxx < yyy:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, X, Y = il()
    x = il()
    y = il()
    if max(x) >= min(y) or X >= Y:
        print('War')
        exit()

    Z = range(max(x), min(y) + 1)
    for z in Z:
        if X < z <= Y:
            print('No War')
            exit()
    else:
        print('War')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, X, Y = il()
    x = il()
    y = il()
    if max(x) >= min(y):
        print('War')
        exit()

    Z = range(max(x), min(y) + 1)
    for z in Z:
        if X < z <= Y:
            print('No War')
            exit()
    else:
        print('War')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, X, Y = il()
    x = il()
    y = il()
    Z = range(max(x), min(y) + 1)
    for z in Z:
        if X < z <= Y:
            print('No War')
            exit()
    else:
        print('War')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xx = tuple(map(int, input().split()))
yy = tuple(map(int, input().split()))

if x > y:
    print('War')
    exit(0)

if min(yy) - max(xx) > 1:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
a = max(x)
b = min(y)
if(a < b):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[N-1] <= y[0] and X < Y and x[N-1] > X and y[0] < Y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[N-1] <= y[0] and X < Y and x[N-1] > X and y[0] < Y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[N-1] <= y[0] and X < Y and x[N-1] > X and y[0] < Y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[N-1] <= y[0]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.sort()
Y.sort()
if X[n-1] < Y[0] and x < y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xs = input().split()
ys = input().split()

for i in range(n):
    xs[i] = int(xs[i])

for i in range(m):
    ys[i] = int(ys[i])

for i in range(x, y+1):
    if i > max(xs) and i <= min(ys):
        print("No War")
        exit()

print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xs = input().split()
ys = input().split()

for i in range(n):
    xs[i] = int(xs[i])

for i in range(m):
    ys[i] = int(ys[i])

if max(xs) <= min(ys):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xs = input().split()
ys = input().split()

for i in range(n):
    xs[i] = int(xs[i])

for i in range(m):
    ys[i] = int(ys[i])

if max(xs) < min(ys):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xs = input().split()
ys = input().split()

for i in range(n):
    xs[i] = int(xs[i])

for i in range(m):
    ys[i] = int(ys[i])

if max(xs) <= max(ys):
    print("No War")
else:
    print("War")