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

if max(xs) < max(ys):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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')
  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()))
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: Wrong Answer

Solution code:
import math

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

Z = math.ceil(max(x))

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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)
ymax = max(ylis)

for i in range(x+1,y+1):
    if i > xmax and i in ylis:
        flag = 1
        break
    
if flag:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
s=list(map(int,input().split()))
t=list(map(int,input().split()))
c=0
max_x=max(s)
min_y=min(t)

for i in range(x+1,y+1):
    if i>max_x and i<=min_y:
        c+=1
if c>0:
    print('No war')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
def resolve():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    ans = 0
    for z in range(X+1, Y+1):
        if max(x)<=z and z<=min(y):
            ans += 1
    print("No War" if ans != 0 else "War")
resolve()

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(xs)
y_=min(ys)
for z in range(x_,y_+1):
    if x<z<=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()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if max(x) + 1 < min(y):
    print ("No War")
else:
    print ("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()))
if x < y and max(xx) <= y and x < min(yy):
    print("No War")
else:
    print("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()))
if x < y and max(xx) < y and x < min(yy):
    print("No War")
else:
    print("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()))
if x < y and max(xx) < min(yy):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xt=list(map(int,input().split()))
yt=list(map(int,input().split()))
xt.sort()
yt.sort()
if x<y and xt[len(xt)-1]<yt[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()))
cnt=0
if max(X)>=min(Y):
  print('War')
else:
  for i in range(max(X),min(Y)+1):
    if x<i and i<=y:
      print('No war')
      cnt+=1
      exit()
  if cnt==0:
    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()))
cnt=0
if max(X)>=min(Y):
  print('War')
else:
  for i in range(max(X)+1,min(Y)+1):
    if x<i and i<=y:
      print('No war')
      cnt+=1
      exit()
  if cnt==0:
    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) else "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[-1]>=y[0]:
    print('War')
else:
    print('No 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[-1]>=Y[0]:
    print("War")
elif x>=Y[0]:
    print("War")
else:
    print("No 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[-1]>=Y[0]:
    print("War")
elif x<Y[0]:
    print("No 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())))
if X[-1]>Y[0]:
    print("War")
elif x<Y[0]:
    print("No 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())))
if X[-1]>Y[0]:
    print("War")
elif x<Y[0]<=y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
a = max(list(map(int, input().split())))
b = min(map(int, input().split()))
print(['War', 'No War'][any((a<i<=b) for i in range(x,y+1))])

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
a = max(list(map(int, input().split())))
b = min(map(int, input().split()))
print(['War', 'No War'][any((a<i<=b) for i in range(x,y))])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xx=[int(i) for i in input().split()]
yy=[int(i) for i in input().split()]
ok=False
for i in range(x,y+1):
    ansx=[0 if j<i else 1 for j in xx]
    ansy=[0 if j>=i else 1 for j in yy]
    if 1 not in ansx and 1 not in ansy:
        ok=True
        break
if ok:
    print("No 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())))
if x[-1]<y[0]:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

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

y = list(map(int,input().split()))
y = min(y)
i = x
ans = ''


for i in range(a,b):
  if x<i and i<=y:
    ans = 1
if ans:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
ans=0
a=list(map(int,input().split()))
b=list(map(int,input().split()))
for i in range(n):
    if a[i]>i and i<=x or y<i:
        ans+=1
for j in range(m):
    if b[j]<i and j<=x or y<j:
        ans+=1
print(ans)
if ans>=1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

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

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

Submission status: Wrong Answer

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

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

flag = True
for z in range(X, Y+1):
    if x < z <= y:
        flag = False
        
if flag:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d=min(y)-max(x)
if d<=0:
    print("War")
    sys.exit()
else:
    for i in range(d+1):
        Z=X+i
        if (Z<=X or Z>Y) or (max(x)>=Z or min(y)<Z):
            print("War")
            sys.exit()
print("No War")

Submission status: Wrong Answer

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

d=min(y)-max(x)
if d<=0:
    print("War")
    sys.exit()
else:
    for i in range(1,d+1):
        Z=X+i
        if (Z<=X or Z>Y) or (max(x)>=Z or min(y)<Z):
            print("War")
            sys.exit()
print("No War")

Submission status: Wrong Answer

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

zx = max(x[-1], xx)
zy = min(y[0], yy)

if yy == x[-1]:
    print('War')
    exit()
if xx == y[0]:
    print('War')
    exit()
if x[-1] == y[0]:
    print('War')
    exit()
print('No War')

Submission status: Wrong Answer

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

zx = max(x[-1], xx)
zy = min(y[0], yy)

if yy == x[-1]:
    print('War')
    exit()
if xx == y[0]:
    print('War')
    exit()
if zx > zy:
    print('War')
    exit()

print('No War')

Submission status: Wrong Answer

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

d=min(y)-max(x)
if d<0:
    print("War")
    sys.exit()
else:
    for i in range(d+1):
        Z=X+i
        if Z<=X or Z>Y:
            print("War")
            sys.exit()
print("No 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) >= min(ly):
  print('War')
else:
  print('No 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 X <= Y and x <= y and x != Y and y != X:
    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_max = max(x)
y_min = min(y)
ans = 'War'
for i in range(1,101):
    if (X < i <=Y ) and (x_max < i <= y_min):
        ans = 'No War'
print(ans)

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

if min(Y) - max(X) > 1:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi=  list(map(int,input().split()))
if x<y and 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_list = list(map(int,input().split()))
y_list = list(map(int,input().split()))
if max(x_list) < min(y_list):
  print('No War')
else:
  print('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()))
if y-x>=1:
  kouho=[t for t in range(y+1)][x+1:]
  p.sort()
  q.sort()
  c=0
  for i in range(0,len(kouho)-1):
    c+=1
    if p[n-1]<kouho[i]<=q[0]:
      print("No War")
      break
    if c==len(kouho):
      print("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()))

m_x = sorted(x,reverse=True)
m_y = sorted(y)

ans = "War"

for i in range(m_x[0],m_y[0]+1):
    if X<i<=Y:
        ans = "No War"


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

ans = 'War'

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

ans = 'No War'

for z in range(X, Y+1):
    if z > sum(x) and z <= sum(y):
        ans = 'War'
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
listx = list(map(int,input().split()))
listy = list(map(int,input().split()))
x_max = max(listx)
y_min = min(listy)
if x_max < y_min and y_min >X:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
n,m,X,Y = map(int,input().split())
x = sorted(map(int,input().split())) + [X]
y = sorted(map(int,input().split())) + [Y]
print("No War" if x[-1] < y[0] else "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()))
print("No War" if x[-1] < y[0] 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()))
maxx = max(X)
miny = min(Y)
for i in range(x+1,y+1):
    if maxx +1 <= miny:
        print("No War")
        break
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)
if maxx +1 < miny:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
icase=0
if icase==0:
    n,m,x,y=map(int,input().split())
    xi=list(map(int,input().split()))        
    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())
xx = list(map(int,input().split()))
yy = list(map(int,input().split()))

xx.sort()
yy.sort()
for i in range(min(x,y)+1,max(x,y)+1):
    if xx[-1] < i and yy[0] >= i:
        print('No war')
        quit()
print('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.sort()
yy.sort()
for i in range(min(x,y)+1,max(x,y)):
    if xx[-1] < i and yy[0] >= i:
        print('No war')
        quit()
print('War')

Submission status: Wrong Answer

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

if min_y<max_x:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
import sys

def main(lines):
  N, M, X, Y = map(int, lines[0].split()) 
  x = list(map(int, lines[1].split()))
  y = list(map(int, lines[2].split()))
  x.sort()
  y.sort()
  if x[N - 1] < y[0] and X < Y:
    print("No War")
  else:
    print("War")


if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)

Submission status: Wrong Answer

Solution code:
import sys

def main(lines):
  N, M, X, Y = map(int, lines[0].split()) 
  x = list(map(int, lines[1].split()))
  y = list(map(int, lines[2].split()))
  x.sort()
  y.sort()
  if x[N - 1] < y[0]:
    print("No War")
  else:
    print("War")


if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)

Submission status: Wrong Answer

Solution code:
n, m, a, b = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()



for z in range(a, b + 1):
  if max(x) < z <= min(y):
    print("No War")
    exit()

print("War")

Submission status: Wrong Answer

Solution code:
n, m, a, b = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()


if x[-1] < y[0]:
  for z in range(a, b + 1):
    if max(x) < z <= min(y):
      print("No War")
      exit()

print("War")

Submission status: Wrong Answer

Solution code:
n, m, a, b = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()

if max(x) < min(y):
  print("No War")
  exit()

print("War")

Submission status: Wrong Answer

Solution code:
n, m, a, b = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()

if x[-1] < y[0]:
  for i in range(x[-1],y[0]+1):
    if a < i <= b:
      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()

for z in range(x[n-1], y[0]):
    if X < z and z <= 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()))

x.sort()
y.sort()

if y[0] >= x[n-1]:
    if x[n-1] > X and y[0] <= 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 = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort()
y.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    x_max = max(x_s)
    y_min = min(y_s)

    ok = False
    for z in range(X+1,Y+1):
        if z > x_max and z <= y_min:
            ok = True
            break
    answer =  "War" if ok else "No War"
    print(answer)





if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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

    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    x_max = max(x_s)
    y_min = min(y_s)

    ok = False
    for z in range(X+1,Y+1):
        if z < x_max and z >= y_min:
            ok = True
            break
    answer =  "War" if ok else "No War"
    print(answer)





if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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

    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    x_max = max(x_s)
    y_min = min(y_s)

    ok = False
    for z in range(X+1,Y+1):
        if z <= x_max or z > y_min:
            ok = True
            break
    answer =  "War" if ok else "No War"
    print(answer)





if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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

    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    x_max = max(x_s)
    y_min = min(y_s)

    ok = False
    for z in range(X,Y+1):
        if z <= x_max or z > y_min:
            ok = True
            break
    answer =  "War" if ok else "No War"
    print(answer)





if __name__ == '__main__':
    main()