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:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 23 21:12:01 2018

@author: masato
"""

N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
xmin = x[0]
ymin = y[0]
xmax = x[-1]
ymax = y[-1]

z = max(xmax,ymin)

iswar = 0

for i in range(len(x)):
    if min(ymin,Y) < x[i]:
        iswar = 1
        break
        
for j in range(len(y)):
    if max(xmax,X) >= y[j]:
        iswar = 1
        break

if iswar == 1:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int, input().split())
px = list(map(int, input().split()))
py = list(map(int, input().split()))
# import ipdb; ipdb.set_trace()
if (x+1) < y:
    if sum([z in range(max(px), min(py)+1) for z in range(x+1,y+1)]) != 0:
        print('No War')
    else:
        print('War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
count = 0
N,M,X,Y = list(map(int,input().split(' ')))
XL = list(map(int,input().split(' ')))
YL = list(map(int,input().split(' ')))
 
for z in range(X+1,Y+1):
  if z>max(X,max(XL)) and z<=min(Y,min(YL)):
    count += 1 

if count>0:
  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()))

for i in range(1,100):
     if(max(x_list)<i and i<=min(y_list)):
        print('No War')
        exit(0)
print('War')
exit(0)

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()
x.reverse()
y.sort()

if (y[0] - x[0]) > 0:
    for i in range(x[0]+1, y[0]+1):
        if (X < i) and (i <= Y) and (x[0] < i) and (y[0] >= i):
            print("No War")
            break
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(X<Y)
#print(min(y)-max(x)>0)
#print((Y>max(x) or X<min(y)))
if X<Y and (min(y)-max(x)>0) and (Y>max(x) or X<min(y)):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
l = input().split()


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

if X < -100:
    X = -100
elif X > 100:
    X = 100

if Y < -100:
    Y = -100
elif Y > 100:
    Y = 100


lx = input().split()
ly = input().split()

lx = [int(z) for z in lx]
ly = [int(z) for z in ly]

lx = sorted(lx)


ly = sorted(ly)

flag = True


if int(ly[0]) - int(lx[N-1]) >= 1:
    for z in range(int(lx[N-1]) + 1, int(ly[0]) + 1):
        if z > X and z <= Y:
            flag = True
        else:
            flag = False
            break
else:
    flag = False

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

Submission status: Wrong Answer

Solution code:
from functools import reduce

N, M, X, Y = tuple(map(int, input().split()))
want_X = set(map(int, input().split()))
want_Y = set(map(int, input().split()))

if X < Y:
    line_X = reduce(lambda acc, x: x if abs(Y - x) < abs(Y - acc) else acc,
        want_X, X)
    line_Y = reduce(lambda acc, y: y if abs(X - y) < abs(X - acc) else acc,
        want_Y, Y)

    print('War' if line_Y < line_X or (abs(line_Y - line_X) < 1 and line_Y != Y) else '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()
x.reverse()
y.sort()

for i in range(x[0]+1, y[0]+1):
    if (X < i) and (i <= Y) and (x[0] < i) and (y[0] >= i):
        print("No War")
        break
    else:
        print("War")
        break

Submission status: Wrong Answer

Solution code:
array = list(map(int, input().split()))
#array.sort(reverse = True)
N = array[0]
M = array[1]
X = array[2]
Y = array[3]

xarray = list(map(int, input().split()))
xarray.sort(reverse = True)
##print(xarray)
xmax = xarray[0]

yarray = list(map(int, input().split()))
yarray.sort()
##print(yarray)
ymin = yarray[0]
if (ymin > xmax):
    if(abs(ymin - xmax) > 1):
        print("No War")
    else:
        print("War")
else:
    print("War")

##print(array)

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

for i in range(1,100):
    if(X<i and i<=Y):
        if(max(x_list)<i and i<=min(y_list)):
            print('No War')
            exit(0)
print('War')
exit(0)

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




xmax=xlist[N-1]
ymax=ylist[M-1]



if xmax+1<ymax and X+1<=Y and X<xmax+1 and Y>=xmax+1 and abs(xmax-ymax)<abs(X-Y):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

xs = list(map(int,input().split()))
ys = list(map(int,input().split()))

#print(M,N,X,Y)
#pArint(xs,ys)
result = "No War"

if X > Y:
    result = "War"

xMax = max(xs)
yMin = min(ys)

if xMax > yMin:
    if result == "No War":
        result = "War"

print(result)

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




xmax=xlist[N-1]
ymax=ylist[M-1]



if xmax+1<ymax and X+1<=Y and X<xmax+1 and Y>=xmax+1 and abs(xmax-ymax)<=abs(X-Y):
    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())

x_max = max(x)
y_min = min(y)

flag_war = True

for z in range(X+1, Y+1):
    if x_max < z:
        if y_min >= z:
            print('No War')
            flag_war = False
        else:
            continue
    else:
        continue
if flag_war == True:
    print('War')

Submission status: Wrong Answer

Solution code:
count = 0
N,M,X,Y = list(map(int,input().split(' ')))
XL = list(map(int,input().split(' ')))
YL = list(map(int,input().split(' ')))
 
for z in range(X+1,Y+1):
	if z>max(XL) and z<=min(YL):
		count += 1 
 
if count>0:
	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()))
a = 0
for z in range (X+1, Y+1):
    for i in range(N):
        if x[i] >= z:
            a = 1
           # break
    for j in range(M):
        if y[j] < z:
            a = 1
           # break
if a == 1:
    print("War")
if a == 0:
    print("No War")

Submission status: Wrong Answer

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

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

if  max_x > min_y:
	print('War')
elif X >= min_y:
    print('War')
elif Y <= max_x:
    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()))

for i in range(1,101):
    if(X<i and i<=Y):
        if(max(x_list)<i and i<=min(y_list)):
            print('No War')
            exit(0)
print('War')
exit(0)

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.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:
M, N, X, Y = map(int, input().split())

xs = list(map(int,input().split()))
ys = list(map(int,input().split()))

#print(M,N,X,Y)
#pArint(xs,ys)
result = "No War"

if X > Y:
    result = "War"

xMax = max(xs)
yMin = min(ys)

if xMax > yMin:
    result = "War"

print(result)

Submission status: Wrong Answer

Solution code:
N, M, X, Y = list(map(int, input().split()))
x = [0 for i in range(N)]
y = [0 for i in range(M)]
x = list(map(int, input().split()))
y = list(map(int, input().split()))
max_x = max(x)
min_y = min(y)
r = [i for i in range(max_x+1, min_y+1)]
print(max_x, min_y, r)
count = 1
flag = False
while(True):
  if X + count in r:
    flag = True
    break
  else:
    if X + count == Y:
      break
    count += 1
if flag:
  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()))
a = 0
for z in range (X+1, Y+1):
    for i in range(N):
        if x[i] >= z:
            a = 1
            break
    for j in range(M):
        if y[j] < z:
            a = 1
            break
if a == 1:
    print("War")
if a == 0:
    print('No War')

Submission status: Wrong Answer

Solution code:
count = 0
N,M,X,Y = list(map(int,input().split(' ')))
XL = list(map(int,input().split(' ')))
YL = list(map(int,input().split(' ')))
 
XL.sort()
YL.sort()
 
for z in range(X+1,Y+1):
	if z>XL[N-1] and z<=YL[0]:
		count = 1 
 
if count>0:
	print('No war')
else:
	print('war')

Submission status: Wrong Answer

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

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

if  max_x > min_y:
	print('War')
elif X+1 >= min_y:
    print('War')
elif Y-1 <= max_x:
    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()))
a = 0
for z in range (X+1, Y+1):
    for i in range(N):
        if x[i] >= z:
            a = 1
            break
    for j in range(M):
        if y[j] < z:
            a = 1
            break
    if a == 1:
        print("War")
        break
if a == 0:
    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()))

if X>Y:
    print("War")
elif max(x)>min(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()))


if min(y)>max(x)&max(x)>Y&min(y)<X:
    print("NoWar")
else:
    print("War")

Submission status: Wrong Answer

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

xs = list(map(int,input().split()))
ys = list(map(int,input().split()))

result = "War"

if X > Y:
    result = "No War"

xMax = max(xs)
yMin = min(ys)

if xMax > yMin:
    if result == "War":
        result = "No War"

print(result)

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

battle_flag=False

X_max=max(x)
Y_min=min(y)

battle_flag=True

for Z in range(X_max,Y_min+1):
    if X < Z and Z <= Y:
        battle_flag=False
        break    
if battle_flag:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
a = input().split() 
n = int(a[0])
m = int(a[1])
x = int(a[2])
y = int(a[3])
a = input().split()
a = [int(s) for s in a]
x_max = max(a)
a = input().split()
a = [int(s) for s in a]
y_min = min(a)
print(y <= x_max , y_min <= x , x_max >= y_min)
if y <= x_max or y_min <= x or x_max >= y_min:
    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()
x.reverse()
y.sort()

if (y[0] - x[0]) > 0:
    for x in range(x[0]+1, y[0]+1):
        if (X < x) and (x <= Y):
            print("No War")
            break
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 min(y)<max(x):
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 23 21:12:01 2018

@author: masato
"""

N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
xmin = x[0]
ymin = y[0]
xmax = x[-1]
ymax = y[-1]

z = max(xmax,ymin)

iswar = 0

for i in range(len(x)):
    for j in range(len(y)):
        if x[i] > z:
            iswar = 1
            break
        elif y[j] <= z:
            iswar = 1
            break
    if iswar == 1:
        break

if iswar == 1:
    print("War")
else:
    print("No 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()))




xmax=xlist[N-1]
ymax=ylist[M-1]


if xmax+1<ylist[0] and X+1<=Y and X<xmax+1 and Y>=xmax+1:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

for i in range(len(xList)):
  xList[i] = int(xList[i])
for j in range(len(yList)):
  yList[j] = int(yList[j])

xList.sort()
yList.sort()

if yList[0] > xList[len(xList) - 1] and yList[0] >= X and Y > xList[len(xList) - 1]:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = list(map(int, input().split()))
x = [0 for i in range(N)]
y = [0 for i in range(M)]
x = list(map(int, input().split()))
y = list(map(int, input().split()))
max_x = max(x)
min_y = min(y)
r = [i for i in range(max_x, min_y+1)]
count = 1
flag = False
while(True):
  if X + count in r:
    flag = True
    break
  else:
    count += 1
    if X + count == Y:
      break
if flag:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int, input().split())
px = list(map(int, input().split()))
py = list(map(int, input().split()))
if max(px) < min(py) and (x+1) < y:
    if sum([z in range(max(px), min(py)+1) for z in range(x+1,y+1)]) != 0:
        print('No War')
    else:
        print('War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y = list(map(int, input().split()))
x = [0 for i in range(N)]
y = [0 for i in range(M)]
x = list(map(int, input().split()))
y = list(map(int, input().split()))
max_x = max(x)
min_y = min(y)
r = [i for i in range(max_x, min_y+1)]
print(r)
count = 1
flag = False
while(True):
  if X + count in r:
    flag = True
    break
  else:
    count += 1
    if X + count == Y:
      break
if flag:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int, input().split())
px = list(map(int, input().split()))
py = list(map(int, input().split()))
if max(px) < min(py) and (x+1) != y:
    if sum([z in range(max(px), min(py)+1) for z in range(x+1,y+1)]) != 0:
        print('No War')
    else:
        print('War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
def main():
    n, m, x, y = list(map(int, input().split()))
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    x_list.append(x)
    y_list.append(y)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')

    print('No War')


if __name__ == '__main__':
    main()

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()))
xmax = max(xlist)
ymin = min(ylist)
if xmax<ymin:
    for z in range(xmax, ymin+1):
        if X<z<=Y:
            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 = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort()
x.reverse()
y.sort()

if (y[0] - x[0]) > 0:
    for x in range(x[0]+1, y[0]+1):
        if (X < x) and (x <= Y):
            print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
import sys

AN, BM, AX, BY = [int(x) for x in input().split()]
As = [int(x) for x in input().split()]
Bs = [int(x) for x in input().split()]

Z = BY

for loct in Bs:
    if loct < Z:
        Z = loct

for loct in As:
    if loct >= Z:
        print('War')
        sys.exit()

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

x_max = max(x)
y_min = min(y)

flag_war = True

for z in range(X+1, Y):
    if x_max < z:
        if y_min >= z:
            print('No War')
            flag_war = False
        else:
            continue
    else:
        continue
if flag_war == True:
    print('War')

Submission status: Wrong Answer

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

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

if  max_x > min_y:
	print('War')
elif data_x.count(Y) != 0:
    print('War')
elif data_y.count(X) != 0:
    print('War')
elif max_x >= Y:    
    print('War')
elif min_y <= X:    
    print('War')
    
else:
    print('No War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split(" "))
list1 = list(map(int,input().split(" ")))
list2 = list(map(int,input().split(" ")))
list1.sort(reverse=True)
list2.sort()
while(True):
    if list1[0] >= Y:
        print("War")
        break
    if list2[0] <= X:
        print("War")
        break
    if list1[0] > list2[0]:
        print("War")
        break
    else:
        print("No War")
        break

Submission status: Wrong Answer

Solution code:
def main():
    n, m, x, y = list(map(int, input().split()))
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    x_list.append(x)
    y_list.append(y)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')

    print('No war')


if __name__ == '__main__':
    main()

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




xmax=xlist[N-1]
ymax=ylist[M-1]


if xmax+1<=ylist[0] and X<xmax+1 and Y>=xmax+1:
    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())

x_max = max(x)
y_min = min(y)

flag_war = True

for z in range(X+1, Y):
    if x_max < z:
        if y_min >= z:
            print('No War')
            print(z)
            flag_war = False
        else:
            continue
    else:
        continue
if flag_war == True:
    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 max_x < Y or min_y > X:
	print("No War")	
else:
	print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F551C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, M, X, Y = read_int_list()
    x = read_int_list()
    y = read_int_list()
    if max(x) < min(y):
        res = 'No War'
    else:
        res = 'War'
    print(res)


main()

Submission status: Wrong Answer

Solution code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, M, X, Y = inpl()
x = inpl()
y = inpl()

x.sort()
y.sort()


for z in range(X + 1, Y + 1):
    if x[-1] < z <= y[0]:
        print('No war')
        break
else:
    print('War')

Submission status: Wrong Answer

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

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

if  max_x > min_y:
	print('War')
elif data_x.count(Y) != 0:
    print('War')
elif data_y.count(X) != 0:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y= map(int, raw_input().split())
xlist= map(int, raw_input().split())
ylist= map(int, raw_input().split())
xlist.sort()
ylist.sort()
if xlist[-1]<=ylist[0] and xlist[-1]<Y and ylist[0]>=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_max = max(x)
y_min = min(y)
result = False
if y_min < x_max:
    result = True
if x_max >= Y or y_min <= X:
    result = True
if result:
    print("War")
else:
    print("No 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()]

def check(Z):
    if not(X < Z and X <= Y):
        return False

    for i in x:
        if not(i < Z):
            return False
    for i in y:
        if not(i >= Z):
            return False
    return True

ans = False
for i in range(-200, 200):
    ans = ans | check(i)

print ('No War' if ans else 'War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
list_x = list(map(int,input().split(' ')))
list_y = list(map(int,input().split(' ')))
 
 
min_range = max(list_x)
max_range = min(list_y)
 
ans = 0
 
for i in range(X+1, Y+1):
  if(i > min_range and i <= max_range):
    ans = 1
 
if (ans == 1):
  print("No war")
elif (ans == 0):
  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()))




xmax=xlist[N-1]
ymax=ylist[M-1]


if xmax+1<ylist[0] and X<xmax+1 and Y>=xmax+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( )))

War = False

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


if xmax > ymin:
    War = True

if X>Y:
    War = True

if X in y or Y in x:
    War = True
    
if War == True:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y= map(int, raw_input().split())
xlist= map(int, raw_input().split())
ylist= map(int, raw_input().split())
xlist.sort()
ylist.sort()
print xlist[-1]
if xlist[-1]<=ylist[0] and xlist[-1]<Y and ylist[0]>=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_max = max(x)
y_min = min(y)
result = False
if y_min <= x_max:
    result = True
if x_max > Y or y_min <= X:
    result = True
if result:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

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

res = 'No War'

if max(xn_list) > min(ym_list):
    res = 'War'

print(res)

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int, input().split())
px = list(map(int, input().split()))
py = list(map(int, input().split()))
if max(px) < min(py):
    if sum([r in range(max(px), min(py)) for r in range(x+1,y+1)]) != 0:
        print('No War')
    else:
        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 min(y)>min(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()))
x_max = max(xs)
y_min = min(ys)
def get_war(x_max, y_min, X, Y):
    if y_min > x_max:
        for z in list(range(x_max, y_min + 1)):
            if (z > X) and (z <= Y):
                return 'War'
            else:
                pass
        else:
            return 'War'
    else:
        return 'War'
print(get_war(x_max, y_min, X, Y))

Submission status: Wrong Answer

Solution code:
head=[int(n) for n in input().split()]
list_x=[int(n) for n in input().split()]
list_x.append(head[2])
list_y=[int(n) for n in input().split()]
if max(list_x) < min(list_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)
result = False
if y_min <= x_max:
    result = True
if x_max >= Y or y_min < X:
    result = True
if result:
    print("War")
else:
    print("No 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()))




xmax=xlist[N-1]
ymax=ylist[M-1]


if xmax+1<ylist[0] and X<xmax+1 and Y>xmax+1:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

a = int(e[0])
b = int(e[1])
c = int(e[2])
d = int(e[3])

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

if xmax < ymax:
    if c < ymax:
        print("No War")
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
str1 = input();
str2 = str1.split(" ")
n = int(str2[0])
m = int(str2[1])
xcap = int(str2[2])
ycap = int(str2[3])

strx = input()
stry = input()
strx2 = strx.split(" ")
stry2 = stry.split(" ")
for i in range(n):
    strx2[i] = int(strx2[i])

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

if max(strx2) >= min(stry2)-1:
    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()))
flag=0
for i in range(N):
  if x[i]==Y:
    flag+=1
for i in range(M):
  if y[i]==X:
    flag+=1
if X>Y:
  flag+=1
if flag>0:
  print("War")
else:
  if min(y)>max(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()))
x_max = max(xs)
y_min = min(ys)
def get_war(x_max, y_min, X, Y):
    if y_min > x_max:
        for z in list(range(x_max, y_min + 1)):
            if (z > X) and (z <= Y):
                return 'No War'
            else:
                pass
        else:
            return 'No War'
    else:
        return 'War'
print(get_war(x_max, y_min, 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(" ")))

flug1=False
flug2=False
for i in range(X,Y+1):
    for j in range(N):
        if i<=x[j]:
            flug1=True
            break

    for j in range(M):
        if i>=y[j]:
            flug1=True
            break

    if flug1==False:
        flug2=True
    flug1=False

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

Submission status: Wrong Answer

Solution code:
def return_border_Z(X_zone, Y_zone):
    if max(X_want_controls) > min(Y_want_controls):
        return None
    else: # max(X_want_controls) <= min(Y_want_controls)
        return min(Y_want_controls)

line1 = input()
X_count, Y_count, X_empire, Y_empire = map(int, line1.split()) # TODO: 値を捨てるアンパッキングの書き方
line2 = input()
X_want_controls = list(map(int, line2.split()))
line3 = input()
Y_want_controls = list(map(int, line3.split()))

Z = return_border_Z(X_want_controls, Y_want_controls)
if Z is None:
    print('War')
# 以降Zはint
elif X_empire < Z and Z <= Y_empire:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
l = input().split(" ")
n= int(l[0])
m= int(l[1])
x= int(l[2])
y= int(l[3])
xcon=[]
ycon= []

xcon = input().split(" ")
for i in range(n):
    xcon[i] = int(xcon[i])

ycon = input().split(" ")
for i in range(m):
    ycon[i]=int(ycon[i])

xcon = sorted(xcon)
ycon = sorted(ycon)

if max(x,xcon[-1]) < min(ycon[0],y):
    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()]
if X>= Y:
  print('War')
else:
  xmax = max(x)
  ymin = min(y)
  if xmax >= ymin:
    print('War')
  else:
    print('No War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = [int(i) for i in input().split(" ")]
x_range = [int(i) for i in input().split(" ")]
y_range = [int(i) for i in input().split(" ")]
war = True
for z in range(x, y):
    if x < z <= y and max(x_range[:n]) < z <= max(y_range[:m]):
        war = False
print("War" if war else "No War")

Submission status: Wrong Answer

Solution code:
n = input().split()
n = sorted(n, reverse=True)

ans = int(n[0]+n[1]) + int(n[2])
print(ans)