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:
def main():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    for t in range(X + 1, Y + 1):
        if max(x + [t]) == t and min(y + [t]) == t:
            print('No War')
            exit()
    print('War')


main()

Submission status: Wrong Answer

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

if max(xlist) > min(ylist):
    print('War')
elif min(ylist) <= x or y < min(ylist):
    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()))

print(["War","No War"][X<min(y) and max(x)<Y])

Submission status: Wrong Answer

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

print(["War","No War"][X<min(y) and max(x)<Y])

Submission status: Wrong Answer

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

    max_x = max(list(dx))
    min_y = min(list(dy))
    if max_x >= min_y:
        print("WAR")
        exit()

    z = x + 1
    while z <= y:
        if z > max_x and z < min_y:
            # print("No War", z)
            print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    max_x = max(list(dx))
    min_y = min(list(dy))

    z = x + 1
    while z <= y:
        if z > max_x and z < min_y:
            print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    max_x = max(list(dx))
    min_y = min(list(dy))

    z = x + 1
    while z <= y:
        if z > max_x and z < min_y:
            print("No War", z)
            # print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    max_x = max(list(dx))
    min_y = min(list(dy))

    z = x + 1
    while z <= y:
        if z > max_x and z <= min_y:
            print("No War", z)
            # print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
A = [a for a in range(-100, 101) if (X < a <= Y) and (max(x) < a <= min(y))]
if len(A) is not 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()))
A = [a for a in range(101) if (X < a <= Y) and (max(x) < a <= min(y))]
if len(A) is not 0: print('No war')
else: print('War')

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
lx = list(map(int, input().split()))
ly = list(map(int, input().split()))
if (max(lx+[x]) < min(ly+[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(max(x)+1, min(y)):
    if X < Z <= Y:
        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()))
for Z in range(max(x), min(y)+1):
    if X < Z <= Y:
        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()))
for Z in range(max(x),min(y)):
    if X < Z <= Y:
        print("No War")
        exit()
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline

_, _, X, Y = map(int, input().split())

lst_x = list(map(int, input().split()))
lst_y = list(map(int, input().split()))

if max(lst_x) <= min(lst_y):
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline

_, _, X, Y = map(int, input().split())

lst_x = list(map(int, input().split()))
lst_y = list(map(int, input().split()))

if max(lst_x) < min(lst_y):
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
 
x = max(map(int, input().split()))
y = min(map(int, input().split()))
 
if y - x >= 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

r = any(all(i < z for i in x) and all(i <= z for i in y) for z in range(X+1, Y+1))
print("No War" if r else "War")

Submission status: Wrong Answer

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

r = any([any(i < z for i in x) and any(i <= z for i in y) for z in range(X+1, Y+1)])
print("No War" if r else "War")

Submission status: Wrong Answer

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

r = [any(i < z for i in x) and any(i < z for i in y) for z in range(X+1, Y+1)]
print("No War" if r else "War")

Submission status: Wrong Answer

Solution code:
NMXY = list(map(int, input().split()))
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if max(xlist) < min(ylist) and NMXY[2] < NMXY[3]:
    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()))
x.sort(reverse=True)
y.sort()
b = False
if(x[0] < y[0]):
  for i in range(X, Y+1):
    for j in range(x[0], y[0]):
      if(i == j):
        b = True
        break
    if(i==j):
      break
if(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()))
if (min(y)-max(x) < 1) or (Y-X < 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()))
if min(y)-max(x) < 1 or Y-X < 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()))
if (min(y)-max(x) <= 1)or (Y-X <= 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()))
if min(y)-max(x) <= 1 or Y-X <= 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()))
if min(y)-max(x) < 1 or Y-X <= 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()))
if min(y)-max(x) < 1 and Y-X <= 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()))
if min(y)-max(x) <= 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()))
if min(y)-max(x) < 1:
  print("War")
else:
  print("No War")

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a==1: print("No War")
    else :print("War")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#x = ip()                              #入力整数1つ
#x,y = (int(i) for i in input().split())      #入力整数横2つ
#x,y,z = (int(i) for i in input().split())    #入力整数横3つ
n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ma = max(a)
mb = min(b)
z = set([i for i in range(ma+1,mb+1)])
xy  =  set([i for i in range(x+1,y+1)])
a = xy.intersection(z)
j(len(a))

Submission status: Wrong Answer

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

x = max(b)
y = min(c)

p = max(a[2],x)
q = min(a[3],y)

if q-p > 0:
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    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()]

    result = "War"

    for i in range(-100, 101):
        if X < i and Y >= i and max(x) < i and min(y) >= i:
            result = "No war"

    print(result)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    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()]

    result = "War"

    for i in range(-100, 101):
        if X < i and Y > i and max(x) < i and min(y) >= i:
            result = "No war"

    print(result)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    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()]

    result = "War"

    for i in range(-100, 101):
        if max(x) < i and min(y) >= i:
            result = "No war"

    print(result)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    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()]

    result = "War"

    for i in range(-111, 111):
        if max(x) < 16 and min(y) >= 16:
            result = "No war"

    print(result)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    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()]

    result = "War"

    for i in range(X + 1, Y + 1):
        if max(x) < 16 and min(y) >= 16:
            result = "No war"

    print(result)

Submission status: Wrong Answer

Solution code:
i=input;i();print('No '*(max(map(int,i().split()))<min(map(int,i().split())))+'War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
Pmax ,Qmin= max(P),min(Q)
if int(Pmax) >= int(Qmin) or (int(Pmax)==Pmax and int(Qmin) == Qmin) and Pmax - Qmin ==1:
  print("War")
else:
  print("No War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
Pmax ,Qmin= max(P),min(Q)
if int(Pmax) >= int(Qmin):
  print("War")
else:
  print("No War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
Pmax ,Qmin= max(P),min(Q)
import math
if math.floor(Pmax) >= math.ceil(Qmin):
  print("War")
else:
  print("No War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if xmax >= ymin:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

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

if xmax > ymin:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

war = True

for z in range(-100,101):
    new_xs = xs + [z]
    new_ys = ys + [z]
    if max(new_xs) == z and min(new_ys) == z and x<z<=y:
        war = False
        
if war:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

war = True

for z in range(-100,101):
    new_xs = xs + [z]
    new_ys = ys + [z]
    if max(new_xs) == z and min(new_ys) == z and x<z<=y:
        war = False
        
if war:
    print('War')
else:
    print('No war')

Submission status: Wrong Answer

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

for a in range(len(x_box)):
    x_box[a]=int(x_box[a])
for a in range(len(y_box)):
    y_box[a]=int(y_box[a])

for i in range(X+1,Y+1):
    if max(x_box)< i <min(y_box):
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

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

for a in range(len(x_box)):
    x_box[a]=int(x_box[a])
for a in range(len(y_box)):
    y_box[a]=int(y_box[a])

res='No War' if (min(y_box)-max(x_box))>0 and min(y_box)>X and max(x_box)<=Y else 'War'
print(res)

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
zl=[i for i in range(x+1,y)]
print(zl)
print(max(xl))
flag=False
for i in zl:
    if i>max(xl) and min(yl)>=i:
        flag=True

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
zl=[i for i in range(x+1,y)]
print(zl)
flag=False
for i in zl:
    if i>max(xl) and min(yl)>=i:
        flag=True

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
zl=[i for i in range(x+2,y)]
flag=False
for i in zl:
    if i>sum(xl) and sum(yl)>=i:
        flag=True

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
zl=[i for i in range(x+1,y)]
flag=False
for i in zl:
    if i>sum(xl) and sum(yl)>=i:
        flag=True

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

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,raw_input().split())
xx = map(int,raw_input().split())
yy = map(int,raw_input().split())
mxx = max(xx)
miyy = min(yy)
if mxx < miyy-1:
    print "No War"
else:
    print "War"

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,raw_input().split())
xx = map(int,raw_input().split())
yy = map(int,raw_input().split())
mxx = max(xx)
miyy = min(yy)
if mxx < miyy:
    print "No War"
else:
    print "War"

Submission status: Wrong Answer

Solution code:
s = raw_input()
s1 = raw_input()
s2 = raw_input()
n,m,x,y = map(int, s.split(" "))
l1 = map(int, s1.split(" "))
l2 = map(int, s2.split(" "))
x1 = max(l1)
y1 = min(l2)

if y > x and x1 < y and y1 >= y:
	print "No War"
else:
	print "War"

Submission status: Wrong Answer

Solution code:
snum = map(int , raw_input().split(" "))
xnum = map(int , raw_input().split(" "))
ynum = map(int , raw_input().split(" "))
X = snum[2]
Y =snum[3]
maxx  = max(xnum)
miny = min(ynum)
result = 'No War'
if snum[0]<1 or snum[1]>100:
    print 'War'
for z in range(maxx, miny):
    if z <= X or z>Y:
        result = 'War'
        break
print result

Submission status: Wrong Answer

Solution code:
N, M, X, Y =(int(x) for x in input().split(" "))

x = max([int(x) for x in input().split(" ")])
y = min([int(x) for x in input().split(" ")])

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y =(int(x) for x in input().split(" "))

x = max([int(x) for x in input().split(" ")])
y = min([int(x) for x in input().split(" ")])

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y =(int(x) for x in input().split(" "))

x = max([int(x) for x in input().split(" ")])
y = min([int(x) for x in input().split(" ")])

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

Submission status: Wrong Answer

Solution code:
snum = map(int , raw_input().split(" "))
xnum = map(int , raw_input().split(" "))
ynum = map(int , raw_input().split(" "))
X = snum[2]
Y =snum[3]
maxx  = max(xnum)
miny = min(ynum)
result = 'No War'
for z in range(maxx, miny):
    if z <= X or z>Y:
        result = 'War'
        break
print result

Submission status: Wrong Answer

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

s = raw_input()
n, m, x, y = [int(x) for x in s.split()]
xx = [int(a) for a in raw_input().split()]
yy = [int(a) for a in raw_input().split()]
xx = sorted(xx)
yy = sorted(yy)

if xx[-1] > y or yy[0] <= x or xx[-1] > yy[0]:
    print 'War'
else:
    print 'No War'

Submission status: Wrong Answer

Solution code:
# 値の取得
N, M, X, Y = map(int, input().split())
# X国の支配地を取得
xi = list(map(int, input().split()))
# Y国の支配地を取得
yi = list(map(int, input().split()))
# 配列間同士で重複があるか確認
if max(xi) < min(yi):
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
# 値の取得
N, M, X, Y = map(int, input().split())
# X国の支配地を取得
xi = list(map(int, input().split()))
# Y国の支配地を取得
yi = list(map(int, input().split()))
# 配列間同士で重複があるか確認
if len(list(set(xi) & set(yi))) >= 1:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
# 値の取得
N, M, X, Y = map(int, input().split())
# X国の支配地を取得
xi = list(map(int, input().split()))
# Y国の支配地を取得
yi = list(map(int, input().split()))
# 配列間同士で重複があるか確認
if len(list(set(xi) - set(yi))) >= 1:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

max_x = max(list(map(int, input().split())))
min_y = min(list(map(int, input().split())))

if min_y - max_x <= 0:
    print("War")
elif(Y >= max_x and X+1 <= min_y):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
Z = -100
message = 'No War'

if X <= Y:
    Z = X+1
    for xi in x:
        if Z < xi:
            Z = xi+1
    print('Z={}'.format(Z))
    for yi in y:
        if Z <= yi:
            pass
        else:
            message = 'War'
            break
    if Z > Y:
        message = 'War'
else:
    message = 'War'

print(message)

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 = -100
message = 'No War'

if X < Y:
    Z = X
    for xi in x:
        if Z < xi:
            Z = xi

    for yi in y:
        if Z < yi:
            message = 'War'
            break
else:
    message = 'War'

print(message)

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())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
ans = 'War'
x.sort(reverse=True)
y.sort(reverse=True)
for z in y:
    if X < z <= Y and z > x[0]:
        ans = 'No War'
        break
print(ans)

Submission status: Wrong Answer

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

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

flag = False
for i in range(y-x):
    if max(X) < i + x + 1 <= min(Y):
        flag = True
        break
print('No war' if flag else 'War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=max(l_x)
y_min=min(l_y)
for i in range(x_max+1,y_min):
    if x<i<=y:
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=sorted(l_x,reverse=True)[0]
y_min=sorted(l_y)[0]
for i in range(x_max+1,y_min,1):
    if x<i<=y:
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=sorted(l_x,reverse=True)[0]
y_min=sorted(l_y)[0]
if x_max>=y_min:
    print('War')
    exit()
for i in range(x_max+1,y_min,1):
    if x<i<=y:
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=sorted(l_x,reverse=True)[0]
y_min=sorted(l_y)[0]
if x_max>=y_min:
    print('War')
    exit()
for i in range(x_max,y_min+1,1):
    if x<i<=y:
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

Solution code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=sorted(l_x,reverse=True)[0]
y_min=sorted(l_y)[0]
if x_max>y_min:
    print('War')
    exit()
for i in range(x_max,y_min+1,1):
    if x<i<=y:
        print('No War')
        exit()
print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int, input().split())
listA = list(map(int, input().split()))
listB = list(map(int, input().split()))
X = abs(X)
Y = abs(Y)
listA = [abs(i) for i in listA]
listB = [abs(i) for i in listB]

Dif = [i for i in range(X+1,Y+1) if Y - X > 0]
Max = max(listA)
Min = min(listB)

if Y - X > 0:
    if Min - Max >= 0:
        for j in range(Max+1,Min+1):
            if j in Dif:
                print('No War')
                break
            else:
                print('War') 
                break  
    else:
        print('War')            
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x = sorted(list(map(int,input().split())))
y = sorted(list(map(int,input().split())))
for i in range(M):
    if y[i] > x[-1] and y[i]> X and y[i] <= Y:
        print("No",end= " ")
        break
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())) 
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: Wrong Answer

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+1 < y and max(x_n)+1 < min(y_m): 
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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-1):
    x_max = max(int(xlist[i]),x_max)
 
for i in range(0,M-1):
    y_min = min(int(ylist[i]),y_min)

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

Submission status: Wrong Answer

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-1):
    x = xlist[i]
    x_max = max(int(x),x_max)

for j in range(0,M-1):
    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: Wrong Answer

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-1):
    x = xlist[i]
    x_max = max(int(x),x_max)

for j in range(0,M-1):
    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: Wrong Answer

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 > y:
    print("War")
elif max(x_n)>min(y_m):
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

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,y+1):
    if a < z and z <= b:
        print("No War")
        quit()
print("War")

Submission status: Wrong Answer

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: 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(x,max(xs))
y=max(y,max(ys))
print('No War'if 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()))
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: Wrong Answer

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='Nor War'
            break
print(comment)

Submission status: Wrong Answer

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
  else:
    continue


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

Submission status: Wrong Answer

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

x.sort()
y.sort()

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

Submission status: Wrong Answer

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

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

    

    
if int(min(x)) > int(max(y)):
  print ("War")
elif int(X) < int(max(y)) or int(Y) > int(min(x)):
  print ("War")
else:
  print ("No War")

Submission status: Wrong Answer

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