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: Accepted

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)and max(x) < Y:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def dimensional_world_tale(x, y, xs, ys):
    xs = sorted(xs)
    maxx = xs[-1]
    if not(x < maxx <= y):
        return "War"
    ys = sorted(ys)
    miny = ys[0]
    if not(x < miny <= y):
        return "War"
    if not(maxx < miny):
        return "War"
    return "No War"

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_war_by_list(x_list, y_list) :
	max_x = max(x_list)
	min_y = min(y_list)
	
	if (max_x < min_y) :
		return False
	else :
		return True

def is_war_by_number(x,y,z) :
	if (x < z and z <= y) :
		return False
	else :
		return True
	

# あ
read_line = [int(i) for i in input().split()]
N = read_line[0]
M = read_line[1]
X = read_line[2]
Y = read_line[3]

x_list = [int(i) for i in input().split()]
y_list = [int(i) for i in input().split()]

if (is_war_by_list(x_list,y_list) or is_war_by_number(X,Y, min(y_list))) :
	print("War")
else :
	print("No War")

Submission status: Accepted

Solution code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split())) 
set1 = set()
set2 = set()
c = 0
maxa = max(a)
minb = min(b)
if maxa < minb:
  for i in range(maxa+1,minb+1):
    set1.add(i)
if x < y:
  for i in range(x+1,y+1):
    set2.add(i)
set3 = set1 & set2
if len(set3) >= 1:
  print("No War")
else:
  print("War")

Submission status: Accepted

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

x_n = list(map(int,input().split()))
y_m = list(map(int,input().split()))

if x < max(x_n) and max(x_n) <min(y_m) and min(y_m) <=y:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

x_max = -100
y_min = 100

for i in range(0,N):
    x = xlist[i]
    x_max = max(int(x),x_max)

for j in range(0,M):
    y = ylist[j]
    y_min = min(int(y),y_min)

if X < Y\
    and int(x_max) < int(y_min)\
    and X < int(y_min)\
    and int(x_max) < Y:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
N ,M ,X ,Y = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
ylist = list(map(int,input().strip().split()))
 
x_max = X
y_min = Y
 
for i in range(0,N):
    x_max = max(int(xlist[i]),x_max)
 
for i in range(0,M):
    y_min = min(int(ylist[i]),y_min)

if x_max < y_min:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
a = list(map(int, input().split()))
for i in range(N):
    if(i == 0):
        mx= a[i]
    else:
        mx = max(a[i],mx)
a = list(map(int, input().split()))
if(mx >= Y):
    print("War")
    quit()
for i in range(M):
    if(i == 0):
        my = a[i]
    else:
        my = min(a[i],my)
if(my <= X):
    print("War")
    quit()
if(mx >= my):
    print("War")
else:
    print("No War")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
M_x = max(x)
m_y = min(y)
if M_x < m_y and M_x < Y and m_y > X:
  print('No War')
else:
  print('War')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    N, M, X, Y = map(int, input().split())
    Xs = list(sorted(list(map(int, input().split()))))
    Ys = list(sorted(list(map(int, input().split()))))

    for z in range(-101, 101):
        if X < z <= Y:
            if Xs[-1] < z <= Ys[0]:
                print("No War")
                return
    print("War")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
xy = list(map(int, input().split()))
x = xy[2]
y = xy[3]
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
if max(xn) < min(ym):
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
def abc110_b():
    _, _, x, y = map(int, input().split())
    city_x = list(map(int, input().split()))
    city_y = list(map(int, input().split()))
    if max(city_x) < min(city_y):
        for i in range(max(city_x), min(city_y)+1):
            if x >= i or i > y:
                return "War"
        return "No War"
    else:
        return "War"


print(abc110_b())

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

N, M, X, Y = list(map(int, input().rstrip().split()))

ax = list(map(int, input().rstrip().split()))
ay = list(map(int, input().rstrip().split()))

bottom_x = max(ax)
top_y = min(ay)

result = 'War'
for Z in range(X + 1, Y + 1):
    if bottom_x < Z and Z <= top_y:
        result = 'No War'
        break

print(result)

Submission status: Accepted

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

s[0].append(x)
s[1].append(y)
p = max(s[0])
q = min(s[1])

if p >= q:
    print("War")
else:
    print("No War")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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

    x = max(x, max(xs))
    y = min(y, min(ys))

    print('No War' if x < y else 'War')


main()

Submission status: Accepted

Solution code:
n, m, x, y = map(int,input().split())
cx = list(map(int,input().split()))
cy = list(map(int,input().split()))
a = max(cx)+1
b = min(cy)
if a>b:
    print('War')
    exit()
for z in range(a, b+1):
    if x<z<=y:
        print('No War')
        exit()
print('War')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
e=list(map(int,input().split()))
f=list(map(int,input().split()))
#print(f)
e.sort()
f.sort()
if e[-1]<f[0]:
	if c<(e[-1]+f[0])/2<=d:
		print("No War")
	else:
		print("War")
else:
	print("War")

Submission status: Accepted

Solution code:
n, m, x, y = map(int, raw_input().split())
arrx = map(int, raw_input().split())
arry = map(int, raw_input().split())
arrx.append(x)
arry.append(y)
if max(arrx)+1 > min(arry):
    print "War"
else:
    print "No War"

Submission status: Accepted

Solution code:
#B問題
N,M,X,Y=input().split()
N=int(N)
M=int(M)
X=int(X)
Y=int(Y)

x=input().split()
y=input().split()

for i in range(0,len(x)):#0から<2まで(1まで)
    x[i]=int(x[i])
for i in range(0,len(y)):#0から<2まで(1まで)
    y[i]=int(y[i])

#X< Z <=Y
comment='War'
for Z in range(X+1,Y+1):#X+1からYまで
    #print(Z)
    #最大x<Zか調べる
    if(max(x) < Z):
        #最小y>=Zか調べる
        if(min(y)>=Z):
            comment='No War'#Norと書いたミス
            break
print(comment)

Submission status: Accepted

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

xlst = list(map(int, input().split()))
ylst = list(map(int, input().split()))

t = 0

for i in range(x+1, y+1):
  #print(i)
  xmax = max(xlst)
  ymin = min(ylst)
  if i > xmax and i <= ymin:
    print("No War")
    t = 1
    break
  else:
    continue


if t ==0:
  print("War")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
lst = [int(s) for s in input().split()]
x = lst[2]
y = lst[3]
a = max([int(s) for s in input().split()])
b = min([int(s) for s in input().split()])

if a < b and x < b and b <= y:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
def solution(a, b):
    if max(a) < min(b):
        return 'No War'
    else:
        return 'War'

def main():
    n, m, x, y = [int(i) for i in raw_input().strip().split()]
    a = [x] + [int(i) for i in raw_input().strip().split()]
    b = [y] + [int(i) for i in raw_input().strip().split()]
    print(solution(a, b))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = list(map(int,input().split(" ")))
N = a[0]
M = a[1]
X = a[2]
Y = a[3]
x = list(map(int,input().split(" ")))
y = list(map(int,input().split(" ")))

max_x = max(x)
min_y = min(y)
Z = X + 1
done = False
while not done:
    if Z > Y:
        done = True
        s = "War"

    elif max_x < Z <= min_y:
        done = True
        s = "No War"

    Z += 1

print(s)

Submission status: Accepted

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

x = sorted(x)
y = sorted(y)
a = x[N-1]
b = y[0]
if (a >= b) or (a>=Y) or (b<=X):
    print("War")
else:
    print("No War")

Submission status: Accepted

Solution code:
n, m, x, y = map(int, raw_input().split())
arrx = map(int, raw_input().split())
arry = map(int, raw_input().split())
arrx.append(x)
arry.append(y)
if max(arrx)+1 > min(arry):
    print "War"
else:
    print "No War"

Submission status: Accepted

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

x = sorted(x)
y = sorted(y)
#print(x[N-1])
#print(y[M-1])

for Z in range(Y+1):
    if X < Z and Y >= Z:
        if x[N-1] < Z:
            if y[0] >= Z:
                print('No War')
                exit()

print('War')

Submission status: Accepted

Solution code:
# abc110_b


def solve(empireA, empireB):
    if min(empireB) - max(empireA) >= 1:
        return "No War"
    else:
        return "War"


if __name__ == "__main__":
    firstline = list(map(int, input("").split(" ")))
    empireA = list(map(int, input("").split(" ")))
    empireB = list(map(int, input("").split(" ")))
    empireA.append(firstline[2])
    empireB.append(firstline[3])
    print(solve(empireA, empireB))

Submission status: Accepted

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('War')
else:
  print('No War')

Submission status: Accepted

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+1 <= Y):
    print('No War')
else:
    print('War')

Submission status: Accepted

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

yM =list(map(int, input().split()))
yM.append(Y)
minY=min(yM)
if(maxX>=minY):
    print("War")
else:
    
    print("No War")

#print("X=",X,"<",minY,"≤",Y,"=Y")
#print(xN,"<",minY)
#print(yM,"≥",minY)

Submission status: Accepted

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

a = max(li1)
b = min(li2)

war = "War"

for i in range(a+1,b+1):
    if x < i <= y:
        war = "No War"
        break

print(war)

Submission status: Accepted

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

z = x+1
check = True
while z <= y and check:
    tempcheck = True

    for i in range(n):
        if xx[i] >= z:
            tempcheck = False
    for i in range(m):
        if yy[i] < z:
            tempcheck = False
    
    if tempcheck:
        print('No War')
        check = False
    z += 1
if check:
    print("War")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Z = sorted(x, reverse=True)[0] + 1
if Z <= sorted(y)[0] and X < Z <= Y:
  print('No War')
else:
  print('War')

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = max(map(int, input().split()))
c = min(map(int, input().split()))
print("No War" if b+1<a[3] and a[2]+1<c and b<c else "War")

Submission status: Accepted

Solution code:
n,m,x,y=map(int,input().split())
xs=list(map(int,input().split()))
ys=list(map(int,input().split()))
xs2=sorted(xs)
ys2=sorted(ys)
if xs2[n-1]<ys2[0] and xs2[n-1]<y and ys2[0]>x:
  print('No War')
else:
  print('War')

Submission status: Accepted

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)
if xmax<ymin and X<ymin and xmax<Y:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:

a= [int(i) for i in input().split()] 
b= sorted([int(i) for i in input().split()] )
c= sorted([int(i) for i in input().split()] )
x =0
for z in range(-100,101):
    if a[2] < z <= a[3]:
       if b[-1]<z:
         if c[0]>=z:
              x = 1
if x == 0:
    print("War") 
if x == 1:
    print("No War")

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))
xx.append(x)
yy.append(y)
if max(xx) >= min(yy):
    print('War')
else:
    print('No War')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m,x,y = list(map(int, input().split()))
xx=list(map(int, input().split()))
yy=list(map(int, input().split()))
print('No War' if max(xx)<min(yy)and x<min(yy) and max(xx)<y else 'War')

Submission status: Accepted

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

x = list(map(int,input().split()))
y = list(map(int,input().split()))

x.sort(reverse=True) # x[0]が最大
y.sort() # y[0]が最小

# xの最大がyの最小以上はWar
if(x[0] >= y[0]):
    print("War")
else:
    if(y[0] <= X or x[0] >= Y):
        print("War")
    else:
        print("No War")

Submission status: Accepted

Solution code:
import sys
n,m,x,y=map(int,input().split())
lx=list(map(int,input().split()))
ly=list(map(int,input().split()))
lx.sort()
ly.sort()
if lx[n-1]>=ly[0] or ly[0]<=x or ly[0]>y:
    print('War')
    sys.exit()
else:print('No War')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m,x,y = map(int, input().strip().split())
mx = max([int(t) for t in input().strip().split()])
my = min([int(t) for t in input().strip().split()])
for z in range(mx+1, my+1):
    if x < z < y:
        print("No War")
        exit(0)
print("War")

Submission status: Accepted

Solution code:
import sys
n,m,x,y=map(int,input().split())
listx=list(map(int,input().split()))
listy=list(map(int,input().split()))
listx.sort(reverse=True)
listy.sort()
for i in range(x+1,y+1):
    if listx[0]<i<=listy[0]:
        print('No War')
        sys.exit()
print('War')

Submission status: Accepted

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.append(X)
y.append(Y)
x.sort()
y.sort()
if x[N] < y[0]:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
tmp = input().split()
x = list(map(int, input().split()))
x.append(int(tmp[2]))
y = list(map(int, input().split()))
y.append(int(tmp[3]))
if max(x) < min(y):
  print("No War")
else:
  print("War")

Submission status: Accepted

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

listx.sort()
maxX = max(listx[n-1],X)
listy.sort()
minY = min(listy[0],Y)

if maxX >= minY:
    print("War")
else:
    print("No War")

Submission status: Accepted

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

listx.sort()
listy.sort()

if max(listx[n-1],x) < min(listy[0],y):
    print("No War")
else:
    print("War")

Submission status: Accepted

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

xi.append(x)
yi.append(y)

xi.sort()
xi.reverse()
yi.sort()

if xi[0]<yi[0]:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
LL = input().split(" ")

LX = list(map(int,input().split()))
LY = list(map(int,input().split()))
	
LX.sort(reverse = True)
LY.sort()

CO = 0

for R in range(int(LL[2])+1,int(LL[3])):
	if LX[0]  >= LY[0]:
		break
	elif LX[0] <= R  <= LY[0] :
		print("No War")
		CO = 1
		break
		
if CO == 0:
	print("War")

Submission status: Accepted

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

x = max(x)
y = min(y)

ans = 'War'
if x < y:
    ans = 'No War'

print(ans)

Submission status: Accepted

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 X < Y and max_x < min_y:
    X += 1
    max_x += 1
    if (X <= max_x and max_x <= Y) or (X <= min_y and min_y <= Y):
        print('No War')
    else:
        print('War')
else:
    print('War')

Submission status: Accepted

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)

m = max(x)
n = min(y)


if n - m > 0:
    print('No War')
else:
    print('War')

Submission status: Accepted

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

zx = list(range(max(x)+1,101))
zy = list(range(-100, min(y)+1))
kanou = set(zx) & set(zy)
if len(kanou) == 0:
    print('War')
else:
    for i in kanou:
        if X < i <= Y:
            print('No War')
            break
    else:
        print('War')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m,x,y = map(int, input().split())
lix = list(map(int, input().split()))
liy = list(map(int, input().split()))
lix.sort()
liy.sort()
flag = 0
for i in range(x+1,y+1):
    if lix[-1] < i and i <= liy[0]:
        flag = 1
        break

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

Submission status: Accepted

Solution code:
n, m, x, y = map(int, raw_input().split())
x = max(x, *map(int, raw_input().split()))
y = min(y, *map(int, raw_input().split()))
print ['War', 'No War'][x < y]

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin

N, M, X, Y = [int(x) for x in stdin.readline().rstrip().split()]
lx = [int(x) for x in stdin.readline().rstrip().split()]
ly = [int(x) for x in stdin.readline().rstrip().split()]

lx.append(X)
ly.append(Y)

if max(lx) >= min(ly):
    print("War")
else:
    print("No War")

Submission status: Accepted

Solution code:
n, m, x, y = 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)

def f():

  if x <= x_max <= y and x <= y_min <= y:

    if x_max < y_min:
      return 'No War'
  
  return 'War'


print(f())

Submission status: Accepted

Solution code:
# 1 Dimensional World's Tale
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 and x < y_min:
    print('No War')
else:
    print('War')

Submission status: Accepted

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


def main():
    n, m, x, y = map(int, input().split())
    xs = list(map(int, input().split())) + [x]
    ys = list(map(int, input().split())) + [y]

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

    if x_max < y_min:
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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+[X])<min(y+[Y]):
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
N,M,X,Y,*xy=map(int,open(0).read().split())
for Z in range(max(X,max(xy[:N]))+1,min(Y,min(xy[N:]))+1):
    print("No War")
    exit()
print("War")

Submission status: Accepted

Solution code:
n,m,X,Y = (int(x) for x in input().split())
x_list = [int(x) for x in input().split()]
y_list = [int(x) for x in input().split()]
x_list.sort(reverse=True)
y_list.sort()
for z in range(X+1,Y):
    if x_list[0] < z and y_list[0] >= z:
        print("No War")
        break
else:
    print("War")

Submission status: Accepted

Solution code:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n=int(arr_data[0][0])
m=int(arr_data[0][1])
x=int(arr_data[0][2])
y=int(arr_data[0][3])

arr_x=list(map(int, arr_data[1]))
arr_y=list(map(int, arr_data[2]))
max_x=max(arr_x)
min_y=min(arr_y)

print("No War" if x<max_x and min_y<y and max_x<min_y else "War")

Submission status: Accepted

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

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

Submission status: Accepted

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 + [X]) < min(y + [Y]):
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
cnds = [int(i) for i in input().split()]

posX = [int(i) for i in input().split()]
posY = [int(i) for i in input().split()]
posX.sort()
posY.sort()

max_x = posX[-1]
min_y = posY[0]
if cnds[2] < cnds[3]:
    if max_x < min_y and cnds[2] < min_y and max_x < cnds[3]:
        print('No War')
    else:
        print('War')
else:
    print('War')

Submission status: Accepted

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_list.append(x)
x_list.sort()
y_list.append(y)
y_list.sort()

if max(x_list) < min(y_list):
    print("No War")
else:
    print("War")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


n, m, x, y = [int(x) for x in stdin.readline().rstrip().split()]

xList = [int(x) for x in stdin.readline().rstrip().split()]
yList = [int(x) for x in stdin.readline().rstrip().split()]


isOk = True

xMax = max(xList)
yMin = min(yList)

ret = [int(z) for z in range(xMax+1, yMin+1) if (x < z) and (z <= y)]

if len(ret) > 0:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]
 
x_max = max(num_list[0])
y_min = min(num_list[1])
 
if x_max >= y_min:
    print('War')
elif x_max < X or y_min > Y:
    print('War')
else:
    print('No War')

Submission status: Accepted

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

xn.sort(reverse = True)
ym.sort()

z = ym[0]

if xn[0] < z:
    if x < z:
        if z < y:
            print("No War")
            exit()
print("War")

Submission status: Accepted

Solution code:
import numpy as np
N, M, X, Y = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))
B = np.array(list(map(int, input().split())))
num = X+1
result = False
while num <= Y:
    resultA = np.array([num for _ in range(N)])
    resultB = np.array([num for _ in range(M)])
    if np.all(resultA > A) and np.all(resultB <= B):
        result = True
        break
    num += 1

if result:
    print('No War')
else:
    print('War')

Submission status: Accepted

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

if xmax >= ymin:
  print("War")
elif set(range(xmax+1, ymin+1)) & set(range(X+1, Y+1)) != set():
  print("No War")
else:
  print("War")

Submission status: Accepted

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

x_list.append(x)
y_list.append(y)

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

if (x_max < y_min):
    print('No War')
else:
    print('War')