Problem:


Score : 200 points

Problem Statement

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

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

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

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

X < Z \leq Y

x_1, x_2, ..., x_N < Z

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

Determine if war will break out.

Constraints

All values in input are integers.

1 \leq N, M \leq 100

-100 \leq X < Y \leq 100

-100 \leq x_i, y_i \leq 100

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

x_i are all different.

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

y_i are all different.

Input

Input is given from Standard Input in the following format:

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

Output

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

Sample Input 1

3 2 10 20
8 15 13
16 22

Sample Output 1

No War

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

X = 10 < 16 \leq 20 = Y

8, 15, 13 < 16

16, 22 \geq 16

Sample Input 2

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

Sample Output 2

War

Sample Input 3

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

Sample Output 3

War



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


Sample output:
No War

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N, M, X, Y = [int(c) for c in input().split()]
xls = [int(x) for x in input().split()]
yls = [int(c) for c in input().split()]
if max (xls) < min(yls) and Y > max(xls) and X < min(yls):
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N, M, X, Y = [int(c) for c in input().split()]
xls = [int(x) for x in input().split()]
yls = [int(c) for c in input().split()]
if max (xls) < min(yls):
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

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)


if x_max>=y_min:
    print('War')
    exit()


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

Submission status: Wrong Answer

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

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)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
print("No War" if max(X) < min(Y) else "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()))
for i in range(x,y+1):
    if i>max(a) and i<=min(b):
        print("No War")
        exit()
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)
for i in range(X+1,Y,1):
  z = i
  if maxX < z and minY <= z:
    print('No War')
    exit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys
N, M, X, Y = map(int, input().split())
xlist = input().split() # string
ylist = input().split() # string

#intXlist = intYlist = []
intXlist = []
intYlist = []
for i in xlist:
    intXlist.append(int(i))
#intXlist.append(X)
for i in ylist:
    intYlist.append(int(i))
#intYlist.append(Y)

# print(max(intXlist))
# print(min(intYlist))

# mx = max(intXlist)
# my = min(intYlist)

# for z in range(X+1, Y+1):
#     return my <= mx:
#         print('No War')
#         sys.exit()
#     else:
#         continue
# print('War')


def judge(z):
    try:
        for i in xlist:
            i = int(i)
            if not i < z:
                return 0
            else:
                continue
        for j in ylist:
            j = int(j)
            if j < z:
                return 0
            else:
                if str(j) == ylist[-1]:
                    print(z)
                    print('No War')
                    sys.exit()
    except Exception as e:
        print(e)
for z in range(X+1, Y+1):
    judge(z)
    if z == Y:
        print('War')

Submission status: Wrong Answer

Solution code:
import sys
N, M, X, Y = map(int, input().split())
xlist = input().split() # string
ylist = input().split() # string

#intXlist = intYlist = []
intXlist = []
intYlist = []
for i in xlist:
    intXlist.append(int(i))
#intXlist.append(X)
for i in ylist:
    intYlist.append(int(i))
#intYlist.append(Y)

# print(max(intXlist))
# print(min(intYlist))

# mx = max(intXlist)
# my = min(intYlist)

# for z in range(X+1, Y+1):
#     return my <= mx:
#         print('No War')
#         sys.exit()
#     else:
#         continue
# print('War')


def judge(z):
    try:
        for i in xlist:
            i = int(i)
            if not i < z:
                return 0
            for j in ylist:
                j = int(j)
                if j < z:
                    return 0
                else:
                    if str(j) == ylist[-1]:
                        print('No War')
                        sys.exit()
    except Exception as e:
        print(e)
for z in range(X+1, Y+1):
    judge(z)
    if z == Y:
        print('War')

Submission status: Wrong Answer

Solution code:
import sys
N, M, X, Y = map(int, input().split())
xlist = input().split() # string
ylist = input().split() # string

#intXlist = intYlist = []
intXlist = []
intYlist = []
for i in xlist:
    intXlist.append(int(i))
#intXlist.append(X)
for i in ylist:
    intYlist.append(int(i))
#intYlist.append(Y)

# print(max(intXlist))
# print(min(intYlist))

# mx = max(intXlist)
# my = min(intYlist)

# for z in range(X+1, Y+1):
#     if mx <= z and z <= my:
#         print('No War')
#         sys.exit()
#     else:
#         continue
# print('War')


def judge(z):
    try:
        for i in xlist:
            i = int(i)
            if not i < z:
                return 0
            for j in ylist:
                j = int(j)
                if j < z:
                    return 0
                else:
                    if str(j) == ylist[-1]:
                        print('No War')
                        sys.exit()
    except Exception as e:
        print(e)
for z in range(X+1, Y+1):
    judge(z)
    if z == Y:
        print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  N,M,X,Y = map(int, input().split())
  max_x = max(map(int,input().split()))
  min_y = min(map(int,input().split()))
  max_xx = max(max_x,X)
  min_yy = min(min_y,Y)
  print(max_x)
  print(min_y)
  print(max_xx)
  print(min_yy)
  
  if min_yy - max_xx > 0:
    print("No War")
  else:
    print("War")
    
main()

Submission status: Wrong Answer

Solution code:
import sys
N, M, X, Y = map(int, input().split())
xlist = input().split() # string
ylist = input().split() # string

#intXlist = intYlist = []
intXlist = []
intYlist = []
for i in xlist:
    intXlist.append(int(i))
#intXlist.append(X)
for i in ylist:
    intYlist.append(int(i))
#intYlist.append(Y)

# print(max(intXlist))
# print(min(intYlist))

mx = max(intXlist)
my = min(intYlist)

for z in range(X+1, Y+1):
    if mx <= z and z <= my:
        print('No War')
        sys.exit()
    else:
        continue
print('War')

Submission status: Wrong Answer

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

a_pos.sort()
b_pos.sort()

num = a_pos[-1] + 1
if num >= y:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

a_pos.sort()
b_pos.sort()

num = a_pos[-1] + 1
if num >= b_pos[0]:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

'''
result1 = (X < Z) and (Z <= Y)

num_violate2 = len([i for i in x if i >= Z])
if num_violate2 > 0:
    result2 = False
else:
    result2 = True

num_violate3 = len([i for i in x if i < Z])
if num_violate3 > 0:
    result3 = False
else:
    result3 = True

if result1 and result2 and result3:
    print('No War')
else:
    print('War')
'''

result1 = X < Y
x = sorted(x)
y = sorted(y)
result2 = x[-1] + 1 < y[0]

if result1 and result2:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
# def makelist(n, m):
#     return [[0 for i in range(m)] for j in range(n)]

yes = "War"
no = "No War"

N, M, X, Y = map(int, input().split())
x = map(int, input().split())
y = map(int, input().split())

if max(x) + 1 <= min(y):
    print(no)
else:
    print(yes)

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = max(x)
y = min(y)
if 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()))
x = max(x)
y = min(y)
if x < y:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
N, K, A, B = list(map(int, input().split()))
A_max = max(list(map(int, input().split())))
B_min = min(list(map(int, input().split())))

if A_max >= A and B_min <= B and A_max <= B_min:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:


def main():
    N, M, X, Y = map(int, input().split())
    x_data = list(map(int, input().split()))
    y_data = list(map(int, input().split()))

    if max(x_data) <= min(y_data):
        if X < min(Y, min(y_data)) and Y > max(X, max(x_data)):
            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())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

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

if xmax >= ymin or xmax > Y or ymin < 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)

if xmax >= ymin or xmax > Y or ymin <= 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()))
xmin=max(x)
ymin=min(y)
for i in range(X+1,Y+1):
    if xmin<=i<=ymin:
        print("No War")
        quit()
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 min(ys) <= max(xs):
    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=[]
for i in range(X+1,Y+1):
  z.append(i)
if max(x)>=min(y):
  print("War")
else:
  for i in range(max(x)+1,min(y)+1):
    if i in z:
      print("No war")
      break
    else:
      if i==min(y) and i not in z:
        print("War")

Submission status: Wrong Answer

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

xis = sorted(list(map(int,input().split())),reverse=True)
yis = sorted(list(map(int,input().split())))
 
ans = 'No War' if xis[0] < yis[0] else 'War'

print(ans)

Submission status: Wrong Answer

Solution code:
"""
map(int,input().split())

X = input().split()
x = []
for i in range(0,len(X)):
    x.append(X[i])

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

x = input().split()
xls = []

for n in range(0,N):
    xls.append(int(x[n]))

y = input().split()
yls = []

for n in range(0,M):
    yls.append(int(y[n]))

xls.sort()
yls.sort()

if xls[len(xls)-1] >= yls[0]:
    print("War")
elif yls[0] <= X:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
#ABC110 B 

#入力
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

#処理
isWar = False
if not X < Y:
    isWar = False
else:
    for Z in range(X+1,Y+1): 
        if max(x) < Z and min(y) >= Z:
            isWar = True
            
if isWar:
    print("War")
else:
    print("NO War")

Submission status: Wrong Answer

Solution code:
#ABC110 B 

#入力
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

#処理
isWar = True
if not X < Y:
    isWar = False
else:
    for Z in range(X+1,Y+1): 
        if max(x) < Z and min(y) >= Z:
            isWar = True
        else:
            isWar = False
            
if isWar:
    print("War")
else:
    print("NO War")

Submission status: Wrong Answer

Solution code:
#ABC110 B 

#入力
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

#処理
isWar = True
if not X < Y:
    isWar = False
else:
    for Z in range(X+1,Y+1): 
        if max(x) < Z and min(y) >= Z:
            isWar = True
            
if isWar:
    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_max  = max(x)
y_min = min(y)
if 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()
y.sort()
if x[n-1] < y[0] and X < y[0] and Y < x[n-1]:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

dif = min(y) - max(x)

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

Submission status: Wrong Answer

Solution code:
import math
n, m, x0, y0 = map(int, raw_input().split())
x = map(int, raw_input().split())
y = map(int, raw_input().split())
end = -99
start = 0
if (max(x) < y0) & (y0 <= min(y)):
	start = math.ceil(max(x))
	end = math.floor(y0)
elif (max(x) <= x0) & (x0 < min(y)):
	start = math.ceil(x0)
	end = math.floor(min(y))
elif (x0 <= max(x)) & (min(y) <= y0):
	start = math.ceil(max(x))
	end = math.floor(min(y))
elif (max(x) <= x0) & (y0 <= min(y)):
	start = math.ceil(x0)
	end = math.floor(y0)

if end >= start:
	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()))

dif = min(y) - max(x)

if dif >= 0 and min(y) > 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()))

dif = min(y) - max(x)

if dif >= 0:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
f = True
xa = max(x)
xa = max(X,xa)
yi = min(y)
yi = min(Y,yi)
if xa+1 < yi:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
f = True
xa = max(x)
yi = min(y)
if xa+1 < yi:
  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.append(x)
y_list.append(y)
if max(x_list) >= min(y_list):
    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()))
x_list.append(x)
y_list.append(y)
x_list = sorted(x_list)
y_list = sorted(y_list)
if x_list[-1] < y_list[0]:
    print('No war')
else:
    print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y =map(int,input().split())
A =list(map(int,input().split()))
B =list(map(int,input().split()))
result =0
flag = 0
for i in range (X+1, Y+1):
    flag = 0
    for j in range (N):
        if A[j] >i:
            flag=1
    for k in range (M):
        if B[k] <i:
            flag=1
    if flag ==0:
        result =1
        
if result !=1:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

array_1 = [i for i in range(X + 1, Y + 1)]
array_2 = [i for i in range(max(x_targets) + 1, min(y_targets) + 1)]
if len(set(array_1)) == len(set(array_2)):
    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()))

i = X + 1
while i < Y + 1:
    if min(y) - max(x) > 0 and min(y) - max(x) == i:
        print('No War')
        break
    else:
        i += 1
if i == Y + 1:
    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()))

def solve():
    for Z in range(-105,105):
        f = 1
        if not X < Z and Z <= Y:
            f = 0
        for xx in x:
            if not xx < Z:
                f = 0
        for yy in y:
            if not yy >= Z:
                f = 0
        if f == 1:
            return False
    return True
print("War" if solve() else "No War")

Submission status: Wrong Answer

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

try:
    Z = range(X + 1, Y + 1)
    if max(X_list) < min(Z) and max(Z) <= min(Y_list):
        print("No War")
    else:
        print("War")
except ValueError:
    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()))

try:
    Z = range(max(X), min(Y))
    if max(X) <= min(Z) and max(Z) <= min(Y):
        print("No War")
    else:
        print("War")
except ValueError:
    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()))

try:
    Z = range(max(X), min(Y))
    if max(X) < min(Z) and max(Z) <= min(Y):
        print("No War")
    else:
        print("War")
except ValueError:
    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()))

try:
    Z = range(max(X), min(Y))
    if min(X) < min(Z) and max(Z) <= min(Y):
        print("No War")
    else:
        print("War")
except ValueError:
    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()))

try:
    Z = range(max(X), min(Y))
    if min(X) <= min(Z) and max(Z) <= min(Y):
        print("No War")
    else:
        print("War")
except ValueError:
    print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split());a,b=list(map(int,input().split())),list(map(int,input().split()));a.sort();b.sort();print("No War"if a[-1]<b[0] and x<b[0]else"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()))

maxX = max(xs)
minY = min(ys)

for tmpZ in range(maxX, minY+1):
	if x < tmpZ <= y:
		print("No War")
		break
else:
	print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
zmin=max(map(int,input().split()))
zmax=min(map(int,input().split()))
#print(zmax,zmin)
for i in range(-100,100):
    #print(zmin<=i,i<zmax,x<i,i<=y,i)
    if all([zmin<=i,i<zmax,x<i,i<=y]):
        print("No War")
        exit()
print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
zmax=max(map(int,input().split()))
zmin=min(map(int,input().split()))
for i in range(-100,100):
    if zmin<=i<zmax and x<i<=y:
        print("No War")
        exit()
print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
a=sorted(map(int,input().split()))
b=sorted(map(int,input().split()))
zmax=b[0]
zmin=a[-1]
for i in range(x+1,y+1):
    if zmin<=i<zmax:
        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.sort()
y.sort()
if x[N-1] < y[0]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y = [int(n) for n in input().split()]
XC = [int(n) for n in input().split()]
YC = [int(n) for n in input().split()]

def main():
    max_x = max(XC)
    min_y = min(YC)
    if max_x < min_y and\
       set(range(X, Y + 1)) & set(range(max_x, min_y + 1)):
        print('No War')
    else:
        print('War')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N, M, X, Y = [int(n) for n in input().split()]
XC = [int(n) for n in input().split()]
YC = [int(n) for n in input().split()]

def main():
    max_x = max(XC)
    min_y = min(YC)
    if max_x < min_y and\
       set(range(X, Y + 1)) & set(range(max_x, min_y)):
        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()))
A = max(X,max(x))
B = min(Y,min(y))
if A < B:
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.sort()
Y.sort()
Z=[i for i in range(x+1,y)]
if X[-1]<Y[0]:
  z=[i for i in range(X[-1]+1,Y[0])]
  if len(set(z)&set(Z))>0:
    print("No War")
  else:
    print("War")
else:
  print("War")

Submission status: Wrong Answer

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

xmax = max(max(xlist),x)
ymin = min(min(ylist),y)

if(xmax<=ymin):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
data = [int(s) for s in input().split()]

N = data[0]
M = data[1]
X = data[2]
Y = data[3]

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]

am = max(a)

bm = min(b)

x = bm -am

i = 0
f = 0

if am >= bm:
    print("War")
    f = 1

else:
    while x < bm:
        
        if x in range(X,Y):
            
            print("No War")
            f = 1
            break
        x += 1


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

Submission status: Wrong Answer

Solution code:
data = [int(s) for s in input().split()]

N = data[0]
M = data[1]
X = data[2]
Y = data[3]

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]

am = max(a)

bm = min(b)

x = bm -am

i = 0
f = 0

if am >= bm:
    print("War")

else:
    while x < bm:
        
        if x in range(X,Y):
            
            print("No War")
            f = 1
            break
        x += 1

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

Submission status: Wrong Answer

Solution code:
data = [int(s) for s in input().split()]

N = data[0]
M = data[1]
X = data[2]
Y = data[3]

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]

am = max(a)

bm = min(b)

x = bm -am

i = 0
f = 0

if am >= bm:
    print("War")

else:
    while x < bm:
        
        if x in range(X,Y):
            
            print("No War")
            f = 1
            break
        x += 1
if f == 0:
    print("War")

Submission status: Wrong Answer

Solution code:
data = [int(s) for s in input().split()]

N = data[0]
M = data[1]
X = data[2]
Y = data[3]

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]

am = max(a)

bm = min(b)

x = bm -am

i = 0
        


if am >= bm:
    print("War")

else:
    while x < bm:
        x += i
        if x in range(X,Y):
            print("No War")
            break
        i += 1

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(j) for j in input().split()]
a = list(range(X,Y+1))
b = list(range(max(x),min(y)+1))
if list (set(a)&set(b))!=[]:
    print('No War')
else :
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
a = list(range(X,Y+1))
b = list(range(max(x),min(y)+1))
if list (set(a)&set(b))!=[]:
    print('No War')
else :
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
# N:Aの入力される座標数
# M:Bの入力される座標数
# X:Aの座標
# Y:Bの座標
x=list(map(int,input().split()))
y=list(map(int,input().split()))

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

Submission status: Wrong Answer

Solution code:
# S = input()
# print('Heisei' if S <= '2019/04/30' else 'TBD')

# n,m,c=map(int,input().split())
# b=list(map(int,input().split()))
# e = [[int(i) for i in input().split()] for i in range(n)]

# array=[None]*3
# print(array)

# print('{0:.10f}'.format(11))

n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
xmax=-1000
ymin=1000

for i in range(1,n):
	if a[i]>xmax:
		xmax=a[i]

for i in range(1,m):
	if b[i]<ymin:
		ymin=b[i]

flag=0

for t in range(x+1,y+1):
	if xmax<t:
		if ymin>=t:
			flag=1
			break

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

Submission status: Wrong Answer

Solution code:
# S = input()
# print('Heisei' if S <= '2019/04/30' else 'TBD')

# n,m,c=map(int,input().split())
# b=list(map(int,input().split()))
# e = [[int(i) for i in input().split()] for i in range(n)]

# array=[None]*3
# print(array)

# print('{0:.10f}'.format(11))

n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
xmax=0
ymin=1000

for i in range(1,n):
	if a[i]>xmax:
		xmax=a[i]

for i in range(1,m):
	if b[i]<ymin:
		ymin=b[i]

flag=0

for t in range(x+1,y+1):
	if xmax<t:
		if ymin>=t:
			flag=1
			break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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