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:
x = list(map(int, input().split()))
n = [list(map(int, input().split())) for i in range(2)]
a = sorted(n[0], reverse=True)[0]
b = sorted(n[1])[0]
war = 0
for i in range(x[2]+1, x[3]):
  if (i > a) and (i <= b):
    war = 1
if war == 1:
  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()))
ans = 'War'
for i in range(-100,101):
    if X < i <= Y and max(x)<i and min(y)>=i:
        ans = 'No War'
        break
print(ans)

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
from fractions  import gcd
#input=sys.stdin.readline
import bisect
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.sort()
y.sort()
i=x[-1]
j=y[0]
if i<j:
    for k in range(i+1,j+1):
        if X<k<=Y:
            print("No War")
            break
    else:
        print("War")
    
else:
    print("War")

Submission status: Accepted

Solution code:
def resolve():
    _, _, X, Y = [int(i) for i in input().split()]
    xx = sorted([int(i) for i in input().split()] + [X])
    yy = sorted([int(i) for i in input().split()] + [Y])
    if xx[-1] >= yy[0]:
        print("War")
    else:
        print("No War")

resolve()

Submission status: Accepted

Solution code:
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N,M,X,Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
f1=False
f2=False

#
ans ="War"
for Z in range(-100,101):
    f1=False
    f2=False
    if X < Z <Y:
        f1 =True
    if x[-1] < Z <=y[0]:
        f2 =True
    if f1 ==f2 ==True:
        ans ="No War"
        break
print(ans)

Submission status: Accepted

Solution code:
i=lambda:map(int,input().split());n,m,x,y=i();print("No "*(max(x,max(i()))<min(min(i()),y))+'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()
threX = max(X,ListX[N-1])
threY = min(Y,ListY[0])
Z = threX+1
if threY >= Z:
  print("No War")
else:
  print("War")

Submission status: Accepted

Solution code:
import sys

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

boarder_of_x = max(ter_x)
boarder_of_y = min(ter_y)

for i in range(X+1,Y+1):
    if boarder_of_x < i <= boarder_of_y:
        print("No War")
        sys.exit()

print("War")

Submission status: Accepted

Solution code:
_, _, X, Y = map(int, input().split())
x = max(map(int, input().split()))
y = min(map(int, input().split()))

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

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
p = max(map(int, input().split()))
q = min(map(int, input().split()))
for Z in range(X+1, Y+1):
  if p<Z and Z<=q:
    print("No War")
    break
else:
  print("War")

Submission status: Accepted

Solution code:
# B - 1 Dimensional World's Tale
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

ans = "War"

for Z in range(-100,101):
    if max(x) < Z <= min(y):
        if X < Z <= Y:
            ans = "No War"
            break

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

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

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

print("War")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
def main():
  n,m,x,y = list(map(int,input().split()))
  xv = list(map(int,input().split()))
  yv = list(map(int,input().split()))
  flg=0
  if max(xv)<=min(yv):
    for i in range(x+1,y+1):
      if(max(xv) < i )and(i <= min(yv)):
        flg=1
        break
  if flg==1:
    print("No War")
  else:
    print("War")
    
main()

Submission status: Accepted

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

Z = []
for z in range(x+1, y+1):
#    print(z)
    if max(Xn) < z and z <= min(Yn):
        Z.append(z)
        print('No War')
        break
else:
    print('War')

Submission status: Accepted

Solution code:
def main():
    N,M,X,Y = map(int,input().split())
    x = [int(i) for i in input().split()]
    y = [int(i) for i in input().split()]
    maxx = max(x)
    miny = min(y)
    for z in range(X+1,Y+1):
        if maxx<z and miny>=z:
            print('No War')
            exit()
    print('War')
main()

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

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

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()))
mx=max(xx)
my=min(yy)
if mx>=my:
  print("War")
elif mx>=y or x>=my:
  print("War")
else:
  print("No War")

Submission status: Accepted

Solution code:
def main():
    N, M, X, Y = map(int, input().split())
    max_x = max(list(map(int, input().split())))
    min_y = min(list(map(int, input().split())))

    for z in range(X + 1, Y + 1):
        if max_x < z <= min_y:
            print("No War")
            exit()
    print("War")


if __name__ == '__main__':
    main()

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()))
ans = [i for i in range(X+1,Y+1)]
for i in ans:
  if max(x) < i:
    if min(y) >= i:
      print('No War')
      exit()
print('War')

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
xm = list(map(int, input().split()))
ym = list(map(int, input().split()))
print('No War' if max([x] + xm) < min([y] + ym) 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.append(X)
y.append(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()))

x.append(X)
y.append(Y)
x = sorted(x)
y = sorted(y)
if max(x) < min(y): print("No War")
else: print("War")

Submission status: Accepted

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

if not ( 1 <= N <= 100 and 1 <= M <= 100 ): sys.exit()
if not ( -100 <= X <= 100 and -100 <= Y <= 100 ): sys.exit()
for I in array_x:
    if not ( -100 <= I <= 100 and array_x.count(I) == 1 and I != X): sys.exit()
for J in array_y:
    if not ( -100 <= J <= 100 and array_y.count(J) == 1 and J != Y): sys.exit()

for I in range(X+1,Y+1):
    if I > max(array_x) and I <= min(array_y):
        print('No War')
        sys.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.append(X)
y.append(Y)
x.sort()
y.sort()

if x[-1] >= y[0]:
    print("War")
else:
    print("No War")

Submission status: Accepted

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

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

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

X, Y = max(X), min(Y)

x = max(X, x)
y = min(Y, y)

if x < y:
    print("No War")
else:
    print("War")

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

if xl[-1] < yl[0]:
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
n,m,X,Y = map(int, raw_input().split(' '))
xis = map(int,raw_input().split(' '))
xis.sort()
yis = map(int,raw_input().split(' '))
yis.sort()

aa = [xis[n - 1], yis[-m]]
aa[0] = max(aa[0], X)
aa[1] = min(aa[1], Y)
print 'No War' if aa[0]<aa[1] else 'War'

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

_, _, x, y = rl()
maxx = max(rm())
miny = min(rm())
if maxx < miny and x<miny and maxx<y:
  print('No War')
else:
  print('War')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
xn = [int(num) for num in input().split()]
yn = [int(num) for num in input().split()]

xn.append(x)
yn.append(y)
xn.sort(reverse=True)
yn.sort()
if xn[0] < yn[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()))
x.append(X)
y.append(Y)
x.sort()
y.sort()
if x[-1] < y[0]:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

if max(x) >= min(y):
    print("War")
else:
    print("No War")

Submission status: Accepted

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


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

if min(y) - max(x) >0:
    print('No War')
else:
    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()))
xxx = max(xx + [x])
yyy = min(yy + [y])
if xxx < yyy:
    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()))
res="War"
for i in range(x+1,y+1):
    if max(a)<i<=min(b):
        res="No War"
        break
print(res)

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, X, Y = il()
    x = il() + [X]
    y = il() + [Y]

    for z in range(-100, 101):
        if max(x) < z <= min(y):
            print('No War')
            exit()
    else:
        print('War')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, X, Y = il()
    x = il()
    y = il()
    if max(x) >= min(y) or X >= Y:
        print('War')
        exit()

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


if __name__ == '__main__':
    main()

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()))
for z in range(-100,101):
    if max(x)<z and z<=min(y) and X<z and z<=Y: print('No War');exit()
print('War')

Submission status: Accepted

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

maxx = max(xx)
miny = min(yy)

if maxx >= miny:
    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()))
xx=max(x)
yy=min(y)
t1=max(X,xx)
t2=min(Y,yy)
if t1<t2:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
N,M,X,Y = map(int,input().split())
XList = list(map(int,input().split()))
YList = list(map(int,input().split()))
if max(XList) >= max(YList):
  print('War')
  exit()
elif X >=Y:
  print('War')
  exit()
for item in range(X+1,Y+1):
  if max(XList) < item <= min(YList):
    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()))

ans = 'War'
Z = [i for i in range(X+1, Y+1)]
z = [i for i in range(max(x)+1, min(y)+1)]

for i in Z:
    if i in z:
        ans = 'No War'
        break

print(ans)

Submission status: Accepted

Solution code:
def resolve():
    N, M, X, Y = list(map(int, input().split()))
    XN = list(map(int, input().split()))+[X]
    YM = list(map(int, input().split()))+[Y]
    xright = sorted(XN)[-1]
    yleft = sorted(YM)[0]
    print("No War" if xright < yleft else "War")


if '__main__' == __name__:
    resolve()

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.sort()
y.sort()
if y[0] - x[-1] >= 1:
    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.append(x)
Y.append(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()))

x.append(X)
y.append(Y)
x = max(x)
y = min(y)

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

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, M, X, Y = LI()
    x = LI()
    y = LI()

    x.sort()
    y.sort()

    has_war = True
    for Z in range(X, Y+1):
        if X < Z <= Y and x[-1] < Z <= y[0]:
            has_war = False

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

if __name__ == '__main__':
    resolve()

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

Submission status: Accepted

Solution code:
n, m, xx, yy = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(xx)
y.append(yy)
if min(y) - max(x) > 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()))
X.sort()
Y.sort()
if X[n-1] < Y[0] and x < y and x < X[n-1] and y > Y[0]:
    print('No War')
else:
    print('War')

Submission status: Accepted

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

for i in range(n):
    xs[i] = int(xs[i])

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

for i in range(x+1, y+1):
    if i > max(xs) and i <= min(ys):
        print("No War")
        exit()

print("War")

Submission status: Accepted

Solution code:
n,m,x,y = map(int,input().split())
x_max = sorted(list(map(int,input().split())))[-1]
y_min = sorted(list(map(int,input().split())))[0]

if x<=x_max<y_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()))
judge=0
for i in range(X+1, Y+1):
    xc=0
    yc=0
    for j in range(n):
        if x[j]<i:
            xc+=1
    for k in range(m):
        if y[k]>=i:
            yc+=1
    if xc==n and yc==m:
        judge+=1
        break
if judge==0:
    print("War")
else:
    print("No War")

Submission status: Accepted

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

if x<y:
  print("No War")
else:
  print("War")

Submission status: Accepted

Solution code:
N,M,X,Y = map(int,input().split())
x = max(X,max(map(int,input().split())))
y = min(Y,min(map(int,input().split())))
a = "War"

for z in range(-101,101):
  if x<z<=y:
    a = "No War"

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    x.append(X)
    y.append(Y)

    if max(x) < min(y):
        ans = "No War"
    else:
        ans = "War"

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

is_war = True

import numpy as np

for Z in range(X+1, Y+1):
    if np.all(np.array(x_list) < Z) and np.all(np.array(y_list) >= Z):
        is_war = False
        break
    
if is_war:
    print("War")
else:
    print("No 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()]

for i in range(Y-X):
    z=X+1+i
    s="no_war"
    for j in range(n):
        if x[j]>=z:
            s="war"
            break
    for j in range(m):
        if y[j]<z:
            s="war"
            break
    if s=="no_war":
        print("No War")
        exit()
print("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()))
for i in range(c+1,d+1):
    if max(e)<i and min(f)>=i:
        print('No War')
        exit()
print('War')

Submission status: Accepted

Solution code:
import math

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

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

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

x_coord = list(map(int, input().split(" ")))
y_coord = list(map(int, input().split(" ")))

is_war = True

for Z in range(X, Y+1):
  if X < Z <= Y and max(x_coord) < Z and min(y_coord) >= Z:
    is_war = False
    break

if is_war:
  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()))
x = sorted(x, reverse=True)[0]
y = list(map(int, input().split()))
y = sorted(y)[0]


for z in range(-100, 101):
    if X < z <= Y and z <= y and x < z:
        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()))

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

ck = 0
ans = 0
for z in range(x+1,y+1):
  for i in a:
    if not i < z:
      break 
  else:
    for i in b:
      if not i >= z:
        break
    else:
      ck = 1
      ans = z
      break

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

for z in range(x+1, y+1):
    if max(lx) < z and min(ly) >= z:
        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()
y.sort()
for i in range(X+1,Y+1,1):
    if i <= min(y) and i > max(x):
        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()
for i in range(X+1,Y+1,1):
    if i <= min(y) and i > max(x):
        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()))
if max(x) < min(y) and X < 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()))
x.sort()
y.sort()
if x[-1]<y[0] and X<y[0]<=Y:
  print('No War')
else:
  print('War')

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N,M,X,Y = I()
x = l()
y = l()
x1 = max(x)
y1 = min(y)
for z in range(X+1,Y+1):
    if x1 < z and y1 >= z:
        print('No War')
        exit()
print('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()]
mx = max(x)
my = min(y)
ok = False
for i in range(X+1, Y+1):
   if mx<i and i<=my:
     ok =True

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

Submission status: Accepted

Solution code:
def imp():return map(int,input().split())
def limp():return list(map(int,input().split()))
n,m,x,y=imp()
lx=max(limp())
ly=min(limp())
if ly>lx and lx+1>x and ly<=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()))
# (max(x), min(y)] & (X, Y]
print('No War' if max(X, max(x)) < min(Y, min(y)) else 'War')

Submission status: Accepted

Solution code:
def hantei(x,y):
  for Z in range(-100,100+1):
    flag=True
    for i in x:
      if i>=Z:
        flag=False
        break
    for i in y:
      if i<Z:
        flag=False
        break
    if flag==True:
      return False
  return True

N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.append(X)
y.append(Y)
print("War" if hantei(x,y)==True else "No War")

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()))
a=max(x,max(xl))
b=min(y,min(yl))
if b-a<=0:
  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()))
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())
a=[int(_) for _ in input().split()]
b=[int(_) for _ in input().split()]
print('War' if x>=min(b) or max(a)>=y or max(a)>=min(b) else 'No War')

Submission status: Accepted

Solution code:
def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    N, M, X, Y = mi()
    x = list(mi())
    y = list(mi())
    for z in range(-100, 101):
        if max(x) < z <= min(y) and X < z <= Y:
            print('No War')
            return

    print('War')

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = 0

xmax = max(xlis)
ymin = min(ylis)

for i in range(x+1,y+1):
    if i > xmax and i <= ymin:
        flag = 1
        break
    
if flag:
    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()))
for i in A:
    X=max(X,i)
for i in B:
    Y=min(Y,i)
if(X<Y):
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    x = [int(i) for i in input().split()]
    y = [int(i) for i in input().split()]
    x.append(a[2])
    y.append(a[3])

    if min(y) > max(x):
        print("No War")
    else:
        print("War")