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())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = max(a)
d = min(b)

if(c < d):
  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[-1] >= y or Y[0] <= x:
    print("War")
elif X[-1] > Y[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()))
if x<y and max(a)<min(b):
    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()))

x_list.sort()
y_list.sort()

if x_list[-1] >= y_list[0]:
    print('War')
else:
    z_list = [z for z in range(x_list[-1], y_list[0])]
    z_list.sort()
    if z_list[0] <= X or z_list[-1] > Y:
        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()
if 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 = 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:
# ABC110b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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')
    exit()
print('War')

Submission status: Wrong Answer

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

xl = [int(i) for i in input().split()]
yl = [int(i) for i in input().split()]

x_max = max(xl)
y_min = min(yl)
z = {i for i in range(x+1,y+1)}
x_y_interval = {i for i in range(x_max+1,y_min+1)} 


if y_min <= x_max:
    print('War')
elif list(z &x_y_interval):
    print('No war')
else:
    print('War')

Submission status: Wrong Answer

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

xl = [int(i) for i in input().split()]
yl = [int(i) for i in input().split()]

x_max = max(xl)
y_min = min(yl)
z = {i for i in range(x,y+1)}
x_y_interval = {i for i in range(x_max+1,y_min+1)} 


if y_min <= x_max:
    print('War')
elif list(z &x_y_interval):
    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()))
maxx=max(x)
miny=min(y)

print("No War" if (X<miny and X>maxx) or (Y<miny and Y>maxx) and maxx<miny 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()))
maxx=max(x)
miny=min(y)

print("No War" if (X<miny or Y>maxx) and maxx<miny else "War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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,Y+1):
    Flag = True
    for i in range(N):
        if x[i] >= z:
            Flag = False
            break
    for i in range(M):
        if y[i] < z or not(Flag):
            Flag = False
            break
    if Flag:
        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()))
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())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
if x < y and x < min(ys) and max(xs) <= y and 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 = list(map(int, input().split()))
ys = list(map(int, input().split()))
if x < min(ys) <= y and max(xs) <= min(ys):
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

p_x=[int(j) for j in input().split()]
p_y=[int(i) for i in input().split()]

max_x=max(p_x)
Z=min(p_y)

if max_x<Z and (X<Z and X<=Y):
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

p_x=[int(j) for j in input().split()]
p_y=[int(i) for i in input().split()]

max_x=max(p_x)
Z=min(p_y)

if max_x<Z and (X<Z 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()))

print("No War") if X<Y and max(x)+1<min(y) 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=sorted(x)
y=sorted(y)

if x[-1] <= y[0] and X < y[0] and x[-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[-1] <= y[0] and X <= y[0] and x[-1] <= Y:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline

def main():
    N,M,X,Y = map(int, input().split())
    z = [i for i in range(X+1,Y+1)]
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    x.sort()
    y.sort()
    xy = [i for i in range(x[-1], y[0]+1)]
    if set(z) & set(xy):
        print("No War")
    else:
        print("War")
            
if __name__ == '__main__':
    main()

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

Submission status: Wrong Answer

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

ans = "War"

if maxNum < minNum:
    for i in range(maxNum, minNum+1):
        if X < i and i <= Y:
            ans = "No War"
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-                                                                              

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)

z_1 = list(range(X+1, Y+1))
z_2 = list(range(x_max+1, y_min+1))

if z_1 and z_2:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
def main():
    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 (min(y) <= Y and min(y) > X) or (max(x) > X and max(x) <= Y):
            print("No War")
        else:
            print("War")
    else:
        print("War")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))
flag = False
for z in range(x,y+1):
    if all([i < z for i in li1]) and all([i >= z for i in li2]):
        flag = True
        #print(z)
        break
        
if flag == True:       
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

for z in range(x,y+1):
    if all([i < z for i in li1]) and all([i >= z for i in li2]):
        flag = True
        break
    else:
        flag = False
        
if flag == True:       
    print("No War")
elif flag == False:
    print("War")

Submission status: Wrong Answer

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

for z in range(x,y+1):
    if all([i < z for i in li1]):
        flag = True
    else:
        flag = False
    if all([i >= z for i in li2]):
        flag = True
    else:
        flag = False
        
if flag == True:       
    print("No War")
elif flag == False:
    print("War")

Submission status: Wrong Answer

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

Flag = True
for z in range(X+1, Y+1):
    if max(x) >= z and min(y) < z:
        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_max = max(list(map(int, input().split())))
y_min = min(list(map(int, input().split())))

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_max = max(list(map(int, input().split())))
y_min = min(list(map(int, input().split())))

if x_max < y and 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()))
print('War' if max(y)>=max(x) else 'No War')

Submission status: Wrong Answer

Solution code:
nmxy=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xm=0
ym=0
if max(x)>nmxy[2]:
    xm=max(x)
else:
    xm=nmxy[2]
if min(y)<nmxy[3]:
    ym=min(y)
else:
    ym=nmxy[3]
if ym<xm:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
nmxy=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xm=0
ym=0
if max(x)>nmxy[2]:
    xm=max(x)
else:
    xm=nmxy[3]
if min(y)<nmxy[3]:
    ym=min(y)
else:
    ym=nmxy[3]
if ym<xm:
    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()))

z = list(range(max(x), min(y)+1))
if len(list(filter(lambda x: X < x <= Y, z))) == 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()))

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

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

Submission status: Wrong Answer

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

if X >= Y:
  print("War")
  exit()
else:
  Z = Y
  
if int(max(x)) < Z and int(min(y)) >= Z:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

if X >= Y:
  print("War")
  exit()
else:
  Z = Y
  
if int(max(x)) < Z and int(min(y)) >= Z:
  print("No War")

Submission status: Wrong Answer

Solution code:
#B - 1 Dimensional World's Tale(ABC110)
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 (X<min(y)):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
#B - 1 Dimensional World's Tale(ABC110)
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 abs(y-x)<=1:
    print("War")
elif abs(min(Y)-max(X))<=1 and max(X)+1<y and min(Y)> 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 Y-X>=1:
    Z=range(X+1,Y+1)
    for z in Z:
        if max(x)<z and min(y)>=z:
            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 Y-X>=1 and 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())
xs=input().split()
ys=input().split()
xs=[int(i) for i in xs]
ys=[int(i) for i in ys]

xs.sort()
ys.sort()
flag=0
if xs[-1]<y:
  threshold=xs[-1]+1
  if ys[0]>=threshold:
      print('No War')
      flag=1
if flag==0:
  print('War')

Submission status: Wrong Answer

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

xs.sort()
ys.sort()
flag=0
if xs[-1]<y:
  threshold=xs[-1]+1
  if ys[0]>threshold:
      print('No War')
      flag=1
if flag==0:
  print('War')

Submission status: Wrong Answer

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

xs.sort()
ys.sort()
if xs[-1]<y and ys[0]>xs[-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())
ans = 0
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for i in range(X,Y):
  k = i
  if i>max(x):
    if i<=min(y):
      ans += 1
      break
if ans == 1:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

xs.sort()
ys.sort()

#print(n, m, x, y)
#print(xs)
#print(ys)

if(xs[-1] < x):
  xs[-1] = x
if(ys[0] > y):
  ys[0] = y

z = ys[0]
if(z < xs[-1]):
  print("War")
elif(x < z and z <= y):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

xs.sort()
ys.sort()

#print(n, m, x, y)
#print(xs)
#print(ys)
z = ys[0]
if(z < xs[-1]):
  print("War")
elif(x < z and z <= y):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

xs.sort()
ys.sort()

#print(n, m, x, y)
#print(xs)
#print(ys)
z = ys[0]
if(z < xs[-1]):
  print("War")
elif(x < z and z <= y):
  print("No War")

Submission status: Wrong Answer

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

xs.sort()
ys.sort()

#print(n, m, x, y)
#print(xs)
#print(ys)
z = ys[0]
if(z < xs[-1]):
  print("War")
elif(x < z and z < y):
  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()))
lix.append(x)
liy.append(y)
lix.sort()
liy.sort()
if lix[n-1] < liy[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()))

for Z in range(X+1, Y+1):
  if max(x)<Z and min(y)>=Z:
    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()))

if x < y and max(xl) < min(yl) and x < min(yl) and max(xl) <= 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_max = max(x)
y_min = min(y)
for i in range(-100,101):
    if X <= i <= Y and x_max < i and y_min >= i:
        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()))

x_max = max(x)
y_min = min(y)
for i in range(-100,101):
    if X <= i <= Y and x_max < i and y_min >= i:
        print("No War")
        print(i)
        exit()
print("War")

Submission status: Wrong Answer

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

for i in range(X,Y+1):
  if (x<i).all() and (y>=i).all():
    print("No War")
    break
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()))
mx = max(xl) + 1
my = min(yl)
for i in range(x + 1, y + 1):
    if mx <= i <= my:
        print(mx, my, i, x, y)
        print("No War")
        exit()
print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x_max = max(x_l)
y_min = min(y_l)
print(x_max, y_min)
if y_min - x_max > 1:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

x_max = max(x_l)
y_min = min(y_l)
print(x_max, y_min)
if y_min - x_max > 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()))

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

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()))
for i in range(1, y+1):
    if (x < i <= y and max(x1) < i and min(y1) >= i):
        print("No War")
        exit(0)
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) or max(A)>Y or min(B)<=X:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
n,m,s,t = 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[n - 1] <= t and y[0] >= s:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,s,t = 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[n - 1] <= s and y[0] >= t:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,s,t = 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[n - 1] < s and y[0] > t:
    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,max(x))
min_Y = 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,max(x))
min_Y = min(Y,min(y))
if max_X<min_Y:
    print("War")
else:print("No war")

Submission status: Wrong Answer

Solution code:
n,a,b,c,*l=map(int,open(0).read().split());print((max(l[:n])<min(l[n:]))*"No "+"War")

Submission status: Wrong Answer

Solution code:
# ABC 110 , B
tmp = [int(el) for el in input().split(' ')]
n = tmp[0]
m = tmp[1]
x = tmp[2]
y = tmp[3]

X = [int(el) for el in input().split(' ')]
Y = [int(el) for el in input().split(' ')]

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

Submission status: Wrong Answer

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

ans = 'War'
for i in range(X, Y):
    if (max(lst_x) < i and min(lst_y) >= i):
        ans = 'No War'
print(ans)

Submission status: Wrong Answer

Solution code:

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

xx = max(xs)
yy = min(ys)

if xx < yy:
    print("No ")
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()))
x2=max(x)
y2=min(y)
if X < y2 <= Y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

x_max = max(xs)
y_min = min(ys)

if x_max < y_min and x_max <= y and y_min > x :
    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()))

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

if X+1>Y:
    print("War")
else:
    if max(x)+1 >min(y):
        print("War")
    else:
        print("No War")

Submission status: Wrong Answer

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

if max(x_li) < min(y_li):
    for i in range(max(x_li)+1, min(y_li)+1):
        print(i)
        if x < i and y >= i:  
            print("No War")
            break
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

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

if max(x_li) < min(y_li):
    for i in range(max(x_li)+1, min(y_li)):
        if x < i and y >= i:  
            print("No War")
            break
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

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

if max(x_li) < min(y_li):
    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[-1] < 0:
    Z = x[-1] - 1
else:
    Z = x[-1] + 1

if Z > y[0]:
    print("War")
elif Z < X:
    print("War")
elif Z >= Y:
    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()

if x[-1] < 0:
    Z = x[-1] - 1
else:
    Z = x[-1] + 1

if Z > y[0]:
    print("War")
elif Z <= X:
    print("War")
elif Z > Y:
    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()

if x[-1] < 0:
    Z = x[-1] - 1
else:
    Z = x[-1] + 1

if Z > y[0]:
    print("War")
elif Z < X:
    print("War")
elif Z > Y:
    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()

if x[-1] < 0:
    Z = x[-1] - 1
else:
    Z = x[-1] + 1

if Z > y[0]:
    print("War")
elif Z < X:
    print("War")
elif Z > X:
    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()

if x[-1] < 0:
    Z = x[-1] - 1
else:
    Z = x[-1] + 1

if Z > y[0]:
    print("War")
elif Z < X:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if min(l[1]) - max(l[0])> 0 and max(l[0]) < y and x <= min(l[1]):
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) - min(l[1]) > 0 and max(l[0]) < y and x <= min(l[1]):
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) - min(l[1]) > 0 and max(l[0]) < y and x < min(l[1]):
    print('No War')
else:
    print('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(x) for x in input().split()]
a = sorted(x + y)
if a[0:n] == sorted(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()))

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

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

flag = 0
for z in range(xmax,ymin):
    if X < z and z <= Y:
        flag = 1
if flag == 0:
    print("War")
else:
    print("No 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.sort()
ys.sort()
if xs[-1] >= ys[0]:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) - min(l[1]) > 0 and x < max(l[0]) and min(l[1]) >= y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) - min(l[1]) > 0 and x < max(l[0]) and min(l[1]) <= y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) - min(l[1]) > 0 and x >= max(l[0]) and min(l[1]) > y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) > min(l[1]) or x >= max(l[0]) or min(l[1]) > y:
    print('War')
else:
    print('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()
print(x_city)
print(y_city)
if y_city[0] - x_city[-1] > 0 and x < y_city[0] and x_city[-1] < y:
    print('No War')
else:
    print('War')