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, x, y = map(int, input().split())
x_city = list(map(int, input().split()))
y_city = list(map(int, input().split()))
x_city.sort()
y_city.sort()
if y_city[0] - x_city[-1] > 0 and x < y_city[0]:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_city = list(map(int, input().split()))
y_city = list(map(int, input().split()))
x_city.sort()
y_city.sort()
print(x_city)
print(y_city)
if y_city[0] - x_city[-1] > 0 and x < y_city[0]:
    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()]
x.sort()
y.sort()
if X < Y and x[-1] < y[0]:
    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())))
Z = y[0]

if Z>=Y:
    Z = Y
print(Z)

if X<Z<=Y and x[N-1]<Z and y[M-1]>=Z:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if max(l_x)>min(l_y) or max(l_x)>=y or min(l_y)<=x:
    print("War")
else:
    print("No 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()]
f3 = False
for z in range(X, Y+1):
    f1 = True
    f2 = True
    for j in x:
        if z<j:
            f1 = False
            break
    for j in y:
        if z>=j:
            f2 = False
            break
    if f1==True and f2==True:
        f3 = True
        break

if f3==True: 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()]
f3 = False
for z in range(X, Y+1):
    f1 = True
    f2 = True
    for j in x:
        if z<=j:
            f1 = False
            break
    for j in y:
        if z>j:
            f2 = False
            break
    if f1==True and f2==True:
        f3 = True
        break

if f3==True: print('No War')
else: print('War')

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
z = "War"

for i in range(a[2],a[3]+1):
  if max(x)<i<min(y):
    z = "No War"
else:
  print(z)

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
z = "War"

for i in range(a[2],a[3]+1):
  if max(b)<i<=min(c):
    z = "No War"
else:
  print(z)

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 and max(x) < Y and Y <= min(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()))

if X < Y and max(x) < min(y) and X < min(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()))

if max(x) < min(y) and X < min(y):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
e = list(map(int, input().split()))
f = list(map(int, input().split()))
e.sort()
f.sort()
for i in range(e[len(e)-1], f[0] + 1):
    if c < i <= d:
        print("No War")
        exit()
print("War")

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
e = list(map(int, input().split()))
f = list(map(int, input().split()))
e.sort()
f.sort()
for i in range(e[len(e)-1], f[0] + 1):
    if c < i < d:
        print("No War")
        exit()
print("War")

Submission status: Wrong Answer

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

Z = np.linspace(X + 1, Y - 1, Y - X - 1)

for i in Z:
    if max(sorted(x)) <= i and i <= min(sorted(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) < min(y):
    for i in range(max(x),min(y)+1):
        if max(x) < i <= min(y):
             print("No War")
             break
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):
    for i in range(max(x),min(y)):
        if max(x) < i <= min(y):
             print("No War")
             break
print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
lstx = list(map(int,input().split()))
lsty = list(map(int,input().split()))
lstx.append(x)
lsty.append(y)
maxx = max(lstx)
miny = min(lsty)
for z in range(x,y+1):
    if (maxx<z) and (miny>=z):
        print(z)
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int, input().split())
x_city = sorted(list(map(int, input().split())))
y_city = sorted(list(map(int, input().split())))

if x_city[len(x_city)-1] < y_city[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.append(X)
y.append(Y)
if max(x)<min(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()))

if max(x)<min(y) and X<min(y) and max(x)<Y and X<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()))

if max(x)<min(y) and X<min(y) and max(x)<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()))

if max(x)<min(y):
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

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

if min(lst_y)<max(lst_x):
    print('War')
else:
    if Y<=max(lst_x) or min(lst_y)<X+1:
        print('War')
    else:
        print('No War')

Submission status: Wrong Answer

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

if max(X) < min(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()

def is_war(x, y, N, M):
    if x[N-1] > y[0]:
        return False
    elif x[N-1] >= Y:
        return False
    elif y[0] <= X:
        return False
    else:
        return True

if is_war(x, y, N, M):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_list = [int(i) for i in input().split()]
y_list = [int(i) for i in input().split()]

x_max = max(x_list)
y_min = min(y_list)

if x_max < y_min:
    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()))
a = 0
b = 0
for i in range(N):
    if x[i] < Y:
        a += 1
for j in range(M):
    if max(x) > X:
        if y[j] >= max(x):
            b += 1
if a == N and b == M:
    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())), reverse = True)
y = sorted(list(map(int, input().split())))

if x[0] < y[0] and (not X in y) and (not Y in x):
  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())), reverse = True)
y = sorted(list(map(int, input().split())))

if x[0] <= y[0] and (not X in y) and (not Y in x):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

if max(xar) + 1 <= min(yar):
    print('War')
    exit()


for i in range(max(xar)+1,min(yar)):
    if i > X and i <= Y:
        print('No War')
        exit()
else:
    print('War')

Submission status: Wrong Answer

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

if max(xar) <= min(yar):
    print('War')
    exit()


for i in range(max(xar)+1,min(yar)):
    if i > X and i <= Y:
        print('No War')
        exit()
else:
    print('War')

Submission status: Wrong Answer

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

if max(xar) <= Y and min(yar) > X:
    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()))

if (max(xs) < min(ys)) and (X < Y):
    print("No 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.append(x)
yl.append(y)
if max(xl)<=min(yl):
  print("No War")
else:
  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()))

if(max(x) < min(y)):
        if( X < Y):
            print('No War')
        else:
            print('War')
else:
    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()))

if(max(x) < min(y)):
    for i in range(max(x),min(y)+1):
        if(i > X and i <= Y):
            print('No War')
            sys.exit()
    print('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)+1 < min(y)):
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
list_x = [int(i) for i in input().split()]
list_y = [int(j) for j in input().split()]
Z = min(list_y)
if X >= Z:
    print("War")
else:
    if max(list_x) >= Z:
        print("War")
    else:
        print("No War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
list_x = [int(i) for i in input().split()]
list_y = [int(j) for j in input().split()]
if X >= Y:
    print("War")
else:
    if max(list_x) +1 >= min(list_y):
        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()))
lsy = list(map(int,input().split()))

if min(lsy) - max(lsx) > 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

lsx = list(map(int,input().split()))
lsy = list(map(int,input().split()))

if min(lsy) - max(lsx) > 0:
    print("No War")
else:
    print("war")

Submission status: Wrong Answer

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

lsx = list(map(int,input().split()))
lsy = list(map(int,input().split()))

if min(lsy) - max(lsx) > 0:
    print("War")
else:
    print("No war")

Submission status: Wrong Answer

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


x = map(int, input().split())
y = map(int, input().split())
a = min(y)
b = max(x)
if X < Y:
    if b >= a:
        print("War")
    elif X == a:
        print("War")
    elif Y == b:
        print("War")
    else:
        print("No War")
else:
    print("War")

Submission status: Wrong Answer

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


x = map(int, input().split())
y = map(int, input().split())
a = min(y)
if X < Y:
    if max(x) >= a:
        print("War")
    elif X == a:
        print("War")
    else:
        print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = input().split()
xi = max(map(int, input().split()))
yi = min(map(int, input().split()))
# print(max(xi),min(yi))
print("No War") if (xi < yi) and (int(x) < yi) else print("War")

Submission status: Wrong Answer

Solution code:
n, m, n1, m1 = [int(x) for x in input().split()]

l = [int(x) for x in input().split()]
ls = [int(x) for x in input().split()]

if (max(l) < min(ls)):
    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()))
if max(A) >= min(B):
  print("War")
elif X >= min(B):
  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.sort()
y.sort()
war = True
for i in range(X+1,Y+2) :
        if x[-1] < i and y[0] >= i :
                        war = False
if war == True :
        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.sort()
y.sort()
war = True
for i in range(X+1,Y+2) :
        if x[-1] < i :
                if y[0] >= i :
                        war = False
if war == True :
        print('War')
else :
        print('No 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()))
if X < Y and max(x_list) < min(y_list):
    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()))

if X < max(x) and max(x) <= min(y) and min(y) <= 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()))

if max(x) < min(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()))
max_x = max(x)
min_y = min(y)

if max_x < min_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()))
max_x = max(x)
min_y = min(y)

if max_x < min_y and (X < max_x <= Y or X < min_y <= 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()))
max_x = max(x)
min_y = min(y)

if max_x <= min_y and (X < max_x <= Y or X < min_y <= 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()))
max_x = max(x)
min_y = min(y)

if max_x <= min_y and (X <= max_x <= Y or X <= min_y <= 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_list = []
y_list = []
for v in x:
    x_list.append(v)
for v in y:
    y_list.append(v)
x_list.sort(reverse=True)
y_list.sort()
if x_list[0]>=y_list[0]:
    print('War')
else:
    XY = list(range(x_list[0]+1, y_list[0]+1))
    for v in XY:
        if (v > X) and (v <= Y):
            print('No War')
            break
        else:
            continue
    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())))
if x<y and y>X:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:

lst_1 = input().split()

N = int(lst_1[0])
M = int(lst_1[1])
X = int(lst_1[2])
Y = int(lst_1[3])

lst_X = input().split()
lst_Y = input().split()

for i in range(N):
    lst_X[i] = int(lst_X[i])
for i in range(M):
    lst_Y[i] = int(lst_Y[i])

X_max = max(lst_X)
Y_min = min(lst_Y)

if (X_max < Y_min) and (X < Y):
    ans = "No War"

else:
    ans = "War"

print(ans)

Submission status: Wrong Answer

Solution code:

lst_1 = input().split()

N = int(lst_1[0])
M = int(lst_1[1])
X = int(lst_1[2])
Y = int(lst_1[3])

lst_X = input().split()
lst_Y = input().split()

for i in range(N):
    lst_X[i] = int(lst_X[i])
for i in range(M):
    lst_Y[i] = int(lst_Y[i])

X_max = max(lst_X)
Y_min = min(lst_Y)

if X_max < Y_min:
    ans = "No War"

else:
    ans = "War"

print(ans)

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()))

maxX = max(xl)
minY = min(yl)
if maxX > Y or minY <= X:
    print('War')
    exit()
for i in range(X,Y+1):
    if i >= maxX and i <= minY:
        print('No War')
        exit()

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()))

maxX = max(xl)
minY = min(yl)

for i in range(X,Y+1):
    if i >= maxX and i <= minY:
        print('No War')
        exit()

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()))

maxX = max(xl)
minY = min(yl)

for i in range(X,Y):
    if i >= maxX and i <= minY:
        print('No War')
        exit()

print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y = [int(nmxy) for nmxy in input().split()]
x = [int(xx) for xx in input().split()]
y = [int(yy) for yy in input().split()]
x_Z = max(x) + 1
Z_y = min(y)
for Z in range(X+1, Y):
  if x_Z < Z <= Z_y:
    print("No War")
    break
else:
  print("War")

Submission status: Wrong Answer

Solution code:
_ = input()
x = list(map(int, input().split()))
y = list(map(int, input().split()))
if max(x) < min(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()))
print("No War" if min(a)<=x<=max(a) and min(b)<=y<=max(b) and max(a) <min(b) else "War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = [ int(v) for v in input().split() ]
xmax = sorted([ int(v) for v in input().split() ] + [x])
ymin = sorted([ int(v) for v in input().split() ] + [y])
ans = "War"
if xmax < ymin:
  ans = "No War"
print(ans)

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
xlist = list(int(i) for i in input().split())
ylist = list(int(i) for i in input().split())
z = max(xlist)+1
if z <= min(ylist):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

if min(Y)-max(X) >= 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()))
if max(X)<min(Y):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int, input().split())
x = [int(_) for _ in input().split()]
y = list(map(int, input().split()))
maxX = max(x)
minY = min(y)

for i in range(Y+1):
    if X < i <= Y and maxX < i and minY >= i:
        print("No War")
        break
    elif i == Y:
        print("War")
        break

Submission status: Wrong Answer

Solution code:
f = lambda: list(map(int, input().split()))
N, M, X, Y = f()
x_max = max(f())
y_min = min(f())
print('No War') if any([True for Z in range(x_max, y_min) if X < Z <= Y]) else print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y = list(map(int,input().split()))
lst_x = input().split()
lst_x_int=[int(i) for i in lst_x]
lst_y = input().split()
lst_y_int=[int(i) for i in lst_y]
#print(lst_x_int,lst_y_int)
#print(max(lst_x_int),min(lst_y_int))

if max(lst_x_int)+1 <= min(lst_y_int) and X < min(lst_y_int):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
import sys
n,m,x,y = map(int, input().split())
X = [int(_) for _ in input().split()]
Y = [int(_) for _ in input().split()]
for i in range(y):
    if x < i:
        for j in X:
            if j <i:
                for k in Y:
                    if k >= i:
                        print("No War")
                        sys.exit()
print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
max_x = max(xlist)
min_y = min(ylist)
flg = 0
for i in range(max_x, min_y+1):
    if i>x and i<=y:
        flg=1
        break
if flg ==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()))
x.sort(reverse=True)
y = list(map(int,input().split()))
y.sort()
if x[0] < y[0]:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

n=list(map(int, input().split()))
m=list(map(int, input().split()))
n.append(x)
m.append(y)
n=sorted(n)
m=sorted(m, reverse=True)

if abs(m[0]) <= abs(n[0]):
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

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

n=list(map(int, input().split()))
m=list(map(int, input().split()))
n=sorted(n)
m=sorted(n, reverse=True)

if abs(m[0]) <= abs(n[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()))
ans = 0
for z in range(X+1,Y+1):
    if max(x) < z and min(y) >= z:
        ans = 1
    if ans == 1:
        j = z
        break
if ans == 0:
    print('War')
else:
    print('No war')

Submission status: Wrong Answer

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

if X < Y and X < min_y and Y > max_x:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])

Z_picklist1 = [range(X + 1, Y + 1)]
Z_picklist2 = [range(x[-1] + 1, y[0] + 1)]
if len(Z_picklist1 + Z_picklist2) != len(set(Z_picklist1 + Z_picklist2)):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
x = [int(j) for j in input().split()]
y = [int(j) for j in input().split()]
if min(y) > max(x):
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
if max(x) < min(y):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
xps = list(map(int,input().split()))
xps.append(x)
x_p = max(xps)
yps = list(map(int,input().split()))
yps.append(y)
y_p = max(yps)

print('No War' if (x_p < y_p) else '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()
print('No War' if x[-1] < y[0] else '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,x,y = map(int,input().split())
x_p = max(list(map(int,input().split())))
y_p = min(list(map(int,input().split())))

print('No War' if (x_p < y_p) and x < y else '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, X, Y = map(int, input().split())
xmax = max(map(int, input().split() + [X]))
ymin = min(map(int, input().split() + [Y]))
 
if xmax < ymin:
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
xmax = max(map(int, input().split() + [X]))
ymin = min(map(int, input().split()))

if xmax < ymin:
    print("No war")
else:
    print("war")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
xmax = max(map(int, input().split() + [X]))
ymin = min(map(int, input().split() + [Y]))

if xmax < ymin:
    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()))
xmax = max(x)
y = list(map(int, input().split()))
ymin = min(y)
r = "war"
for z in range(X + 1, Y):
    if xmax < z and ymin >= z and x.count(X) == 0 and y.count(Y) == 0:
        r = "No war"
        break

print(r)

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
xmax = max(list(map(int, input().split())))
ymin = min(list(map(int, input().split())))
r = "war"
for z in range(X, Y):
    if xmax < z and ymin >= z and xmax != Y and ymin != X:
        r = "No war"
        break

print(r)

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()))


if X <= Y and max(x_list) <= min(y_list):
    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()))

print(X)
print(x_list)

if X <= Y and max(x_list) <= min(y_list):
    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()))
judge = False
for i in range(X,Y):
    if all([v < i for v in x]) and all([v >= i for v in y]):
        judge = True
        break
if judge:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
listx = [int(i) for i in input().split()]
listy = [int(i) for i in input().split()]
listx.append(x)
listy.append(y)
maxx = max(listx)
miny = min(listy)
if (miny > maxx):
    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()))
maxs = max(x)
mins = min(y)

if X <= max(x) and Y >= min(y) and max(x) <= min(y):
    ans = 'No War'
else:
    ans = '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()))
maxs = max(x)
mins = min(y)

if X <= max(x) and Y >= min(y):
    ans = 'No War'
else:
    ans = 'War'
print(ans)

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
a=map(int,input().split())
b=map(int,input().split())
A=max(a)
B=min(b)
D=0
for w in range(A+1,B+1):
 if x<w<=y:
  D+=1

if D>=1:
 print ("No war")
else:
 print("War")

Submission status: Wrong Answer

Solution code:
import sys
n,m,X,Y = list(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) and (X < min(y)):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
import sys
n,m,X,Y = list(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) and (X < min(y)):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
import sys
n,m,_,__ = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
if max(x) <= min(y):
    print("No War")
else:
    print("War")