Problem:


Score : 200 points

Problem Statement

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

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

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

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

X < Z \leq Y

x_1, x_2, ..., x_N < Z

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

Determine if war will break out.

Constraints

All values in input are integers.

1 \leq N, M \leq 100

-100 \leq X < Y \leq 100

-100 \leq x_i, y_i \leq 100

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

x_i are all different.

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

y_i are all different.

Input

Input is given from Standard Input in the following format:

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

Output

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

Sample Input 1

3 2 10 20
8 15 13
16 22

Sample Output 1

No War

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

X = 10 < 16 \leq 20 = Y

8, 15, 13 < 16

16, 22 \geq 16

Sample Input 2

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

Sample Output 2

War

Sample Input 3

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

Sample Output 3

War



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


Sample output:
No War

Submission status: Accepted

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

a+=list(map(int, input().split()))
b+=list(map(int, input().split()))

print("{}".format("No War" if max(a)<min(b) else "War"))

Submission status: Accepted

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

Submission status: Accepted

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

xx=max(x)
z=min(y)

if xx<z and X<z and z<=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()))

lower = max(X)
upper = min(Y)
ans ='War'
  
for z_i in range(x+1,y+1):
  if lower < z_i <= upper:
    ans ='No War'
    
print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_x = max(x)
min_y = min(y)

if max_x >= min_y:
    print('War')
    exit()

if X >= max_x:
    print('War')
    exit()

if min_y > Y:
    print('War')
    exit()

print('No War')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N,M,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
if x<y:
    X.append(x)
    Y.append(y)
    X.sort()
    Y.sort()
    if X[-1]<Y[0]:
        print('No War')
    else:
        print('War')
else:
    print('War')

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
Z=0
flag=0
x.sort()
y.sort()
#print(N,M,X,Y,x,y)
#print(x[N-1],y[0])

if (x[N-1]>=y[0]):
    print("War")
else:
    for i in range(X+1,Y+1):
        if (x[N-1]==i):
            flag=flag+1
        if(y[0]==i):
            flag=flag+1
    if flag==2:
        print("No War")
    else:
        print("War")

Submission status: Accepted

Solution code:
import sys

N,M,X,Y=list(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+1,Y+1,1):
	if x[-1]<Z and y[0]>=Z:
		print("No War")
		sys.exit()

print("War")

Submission status: Accepted

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

max_x = max(x_coordinates)
min_y = min(y_coordinates)

# 条件 2,3 x 座標の最大値よりも、y 座標の最小値が大きい
if max_x >= min_y:
    print('War')
else :
    flag = False
    # 条件2 x 座標のより大きい数から、y 座標の最小値までに　X より大きく、 Y より小さい数があるかを探す
    for i in range(max_x + 1, min_y +1):
        if i > X and i <= Y:
            flag = True
            break

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

Submission status: Accepted

Solution code:
f = lambda : map(int, input().split())
n, m, x, y = f()
lx = [x]+list(f())
ly = [y]+list(f())
print(['War','No War'][max(lx)<min(ly)])

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

Submission status: Accepted

Solution code:
#走らせながら入力例を参考に足りないアルゴリズムを修正していく感じ

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

Submission status: Accepted

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

Submission status: Accepted

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

if rightx < min(y, lefty) and x < lefty:
  print('No War')
else:
  print('War')

Submission status: Accepted

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()]
_X = max(X, max(x))
_Y = min(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.sort(reverse=True)
y.sort()
if x[0] < y[0] and X < y[0] and x[0] < Y:
  print("No War")
else:
  print("War")

Submission status: Accepted

Solution code:
n,m,a,b = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if min(y)>a and max(x)<min(y) and min(y) <= b:
  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())) + [X]
y = list(map(int, input().split())) + [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 = max(map(int, input().split()))+1
y = min(map(int, input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys
# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M, X, Y = map(int, readline().split())
x = [int(x) for x in readline().split()]
y = [int(y) for y in readline().split()]

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M, X, Y = map(int, readline().split())
x = [int(x) for x in readline().split()]
y = [int(y) for y in readline().split()]

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

Submission status: Accepted

Solution code:
import sys

use_clipboard=True
bbn=1000000007
	
#+++++

		
def main():
	n,m,x_c,y_c = map(int, input().split())
	xl=list(map(int, input().split()))
	yl=list(map(int, input().split()))
	xl.append(x_c)
	yl.append(y_c)
	#pa(xl)
	#pa(yl)
	if max(xl)+1 <= min(yl):
		print('No War')
	else:
		print('War')
	return 
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
class input_clipboard:
	def __init__(self,s):
		self.input_l=s.splitlines()
		self.ii=0
		
	def input(self):
		ret = self.input_l[self.ii]
		self.ii+=1
		return ret

if __name__ == "__main__":
	if sys.platform =='ios':
		if use_clipboard:
			import clipboard
			input_text=clipboard.get()
			ic=input_clipboard(input_text)
			input = lambda : ic.input()
			#sys.stdin=clipboard.get()
		else:
			sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    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):
        for xi in x:
            if xi>=Z:
                break
        else:
            for yi in y:
                if yi<Z:
                    break
            else:
                print('No War')
                exit()
    print('War')
            
                

if __name__ == '__main__':
    main()

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

max_x = max(x)
min_y = min(y)
z = [i for i in range(-100, 101) if X < i <= Y and max_x < i <= min_y]
if z:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
def solve():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    
    max_x = max(X, max(x))
    min_y = min(Y, min(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 = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

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

ans='War'
for i in range(xmax+1,ymin+1):
  if x<i<=y:
    ans='No War'
    break
print(ans)

Submission status: Accepted

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:
  ans='War'
  for i in range(xmax+1,ymin+1):
    if x<i<=y:
      ans='No War'
      break
  print(ans)

Submission status: Accepted

Solution code:
n,m,x,y = map(int,input().split())
l1 = list(map(int,input().split()))
l2 = list(map(int,input().split()))
l1.sort()
l2.sort()
for i in range(x+1,y+1):
  if l1[-1] < i <= l2[0]:
    print("No War")
    exit()
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()))

judge = sorted(xList,reverse=True)[0]+1

if judge <= sorted(yList)[0] and x < judge <= y:
  print("No War")
else:
  print("War")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(x+1, y+1):
  if i>max(lx) and i<=min(ly):
    z = True

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

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# import re
# import array
# import copy
# import functools
# import operator

# import collections
# import itertools
# import bisect
# import heapq

# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace

# from queue import PriorityQueue as pq

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )
# # from itertools import accumulate
# # from collections import deque

# from operator import mul
# from functools import reduce

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random
# import time


def reverse_range(a, b):  # b < a ,  get [b, a)
    return range(b, a, -1)  # range(a, b+1, -1)


def main():
    n, m, x, y = map(int, input().strip().split())
    l_x = list(map(int, input().strip().split()))
    l_x.sort(reverse=True)
    l_y = list(map(int, input().strip().split()))
    l_y.sort()

    eprint("range ", end=": ")
    eprint([i for i in reverse_range(x, y)[::-1]])

    for i in reverse_range(x, y)[::-1]:
        if l_x[0] < i <= l_y[0]:
            print("No War")
            return
    print("War")
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,M,X,Y = map(int,input().split())
x = [_ for _ in map(int,input().split())]
y = [_ for _ in map(int,input().split())]
Z = [z for z in range(-100,101)]
x.sort(reverse=True)
y.sort()
num = 0

for z in Z:
    if X<z and z<=Y:
        if x[0]<z and y[0]>=z:
            print('No War')
            num += 1
            break
    else:
        continue
if num == 0:
    print('War')

Submission status: Accepted

Solution code:
n,m,x,y = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
if max(X) < y and max(X) < min(Y) and min(Y) > x:
    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()]

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

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
A.append(X)
B.append(Y)
a=sorted(A)
b=sorted(B)

if a[-1]<b[0]:
  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()))
MA = max(max(A), X)
mB = min(min(B), Y)
if MA < mB:
  print("No War")
else:
  print("War")

Submission status: Accepted

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

if Y <= max(xs) or min(ys) <= X or min(ys) <= max(xs):
    print('War')

else:
    print('No War')

Submission status: Accepted

Solution code:
a,b,x,y=map(int,input().split())
print(['War','No War'][sorted([x]+[int(i) for i in input().split()])[-1]<sorted([y]+[int(i) for i in input().split()])[0]])

Submission status: Accepted

Solution code:
import sys

n, m, X, Y = map(int, sys.stdin.readline().split())
*x, = map(int, sys.stdin.readline().split())
*y, = map(int, sys.stdin.readline().split())

def main():
    return 'No War' if max(X, max(x)) < min(Y, min(y)) else 'War'

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

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

# めっちゃ回りくどい解法
# x_list = sorted([int(i) for i in input().split()])
# y_list = sorted([int(i) for i in input().split()])
#
# x = x_list[-1]
# y = y_list[0]
# if x < y and any([X < z <= Y for z in range(x+1, y+1)]):
#     print('No War')
# else:
#     print('War')
#

# https://atcoder.jp/contests/abc110/submissions/9348852 がとてもスマート

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

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

Submission status: Accepted

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

x = x_list[-1]
y = y_list[0]
if x < y and any([X < z <= Y for z in range(x+1, y+1)]):
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
xs = list(map(int, input().split()))+[X]
ys = list(map(int, input().split()))+[Y]
print(("No " if max(xs) < min(ys) 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_max = max(X)
y_min = min(Y)

for i in range(x+1,y+1):
  if x_max < i and y_min >= i:
    print("No War")
    exit()

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

if X <= Y:
	Z = list(range(X+1,Y+1))
else:
	print('War')
	sys.exit()

Z_x = max(x)+1
Z_y = min(y)
if Z_x <= Z_y:
	Z_xy = list(range(Z_x,Z_y+1))
else:
	print('War')
	sys.exit()

for i in Z_xy:
	if i in Z:
		print('No War')
		sys.exit()
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()))

ans = 'War'

for i in range(x + 1 ,y + 1):
    if max(xl) < i <= min(yl):
        ans = 'No War'
        break

print(ans)

Submission status: Accepted

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

x_z = max(x) + 1  #以上 最低ライン
y_z = min(y)  #以下 最高ライン

if x_z <= y_z:
  if X < x_z <= Y:
    ans = "No War"
  else:
    for i in range(abs(y_z - x_z)):
      if X < x_z <= Y:
       ans = "No War"
       break
      else:
        x_z += 1
  if not X < x_z <= Y:
    ans = "War"
else:
  ans = "War"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, M, X, Y = map(int, input().split())
li_x = list(map(int, input().split()))
li_y = list(map(int, input().split()))
li_x.append(X)
li_y.append(Y)
li_x.sort()
li_y.sort()
if li_x[0] <= li_y[0] <= li_x[-1] or li_x[0] <= li_y[-1] <= li_x[-1]:
    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()))

Z = max(x) + 1

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

Submission status: Accepted

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

ans="War"

if xx[-1]<yy[0] and xx[-1]<y and x<yy[0]:
  ans="No War"

print(ans)

Submission status: Accepted

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

print("No War" if xs < ys and x <= xs and ys <= y else "War")

Submission status: Accepted

Solution code:
N,M,X,Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
for i in range(X+1, Y+1):
  if max(x) < i <= min(y):
    print('No War')
    exit()
print('War')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
N = li[0]
M = li[1]
X = li[2]
Y = li[3]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
maxx = -1000
for i in range(N) :
    maxx = max(maxx,x[i])
miny = 1000
a = "War"
for i in range(M) :
    miny = min(miny,y[i])
maxx = max(X,maxx)
miny = min(Y,miny)
if maxx < miny :
    a = "No War"
print(a)

Submission status: Accepted

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

zx = max(x, max(X)); zy = min(y, min(Y))
print('No War') if zx < zy else print('War')

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N, M, X1, Y1 = list(map(int, sys.stdin.buffer.readline().split()))
X = list(map(int, sys.stdin.buffer.readline().split()))
Y = list(map(int, sys.stdin.buffer.readline().split()))

X = np.array(X + [X1], dtype=int)
Y = np.array(Y + [Y1], dtype=int)
ok = X.max() < Y.min()
if ok:
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
# coding: utf-8


(n,m,x,y) = [int(i) for i in input().rstrip().split(" ")]

xlist = [int(i) for i in input().rstrip().split(" ")]
ylist = [int(i) for i in input().rstrip().split(" ")]

xlist.append(x)
ylist.append(y)

xlist = sorted(xlist)
xlist.reverse()

ylist = sorted(ylist)

if xlist[0] < ylist[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()))

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

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
x=max([int(i) for i in input().split()])
y=min([int(i) for i in input().split()])
flg=False
for i in range(X+1,Y+1):
  if x<i<=y:
    flg=True
print("No War" if flg 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()))

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

Submission status: Accepted

Solution code:
n, m, X, Y = map(int, input().split())
x_lst = list(map(int, input().split()))
y_lst = list(map(int, input().split()))
x_lst.append(X)
y_lst.append(Y)
print('No War' if max(x_lst) < min(y_lst) 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()))
max_X=max(X)
min_Y=min(Y)
print('No War' if max_X<min_Y and max_X<y and x<min_Y else 'War')

Submission status: Accepted

Solution code:
#coding:utf-8
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)
X_max = max(X)
Y_min = min(Y)

if X_max < Y_min:
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
import numpy as np

N, M, X, Y = map(int, input().split())
lst_x = list(map(int, input().split()))
lst_y = [int(y) for y in input().split()]

lst = np.arange(X + 1, Y + 1)
lst = [x for x in lst if x > max(lst_x)]
lst = [y for y in lst if y <= min(lst_y)]

print('War') if len(lst) == 0 else print('No War')

Submission status: Accepted

Solution code:
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")

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()))
x_list.sort()
y_list.sort()
ans = min(y_list[0], y) - max(x_list[-1], x)
if ans >= 1:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
import sys

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

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

def check_x(x, Z):

    for element in x:
        if element >= Z:
            return False
    
    return True

def check_y(y, Z):

    for element in y:
        if element < Z:
            return False
    
    return True


for Z in range(X+1, Y+1, 1):
    if check_x(x, Z)==True and check_y(y, Z)==True:
        print("No War")
        sys.exit()


print("War")

Submission status: Accepted

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

if max(X,max(x1)) < min(Y,min(x2)):   
    print("No War")
else:
    print("War")

Submission status: Accepted

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

a.sort(),b.sort()

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

Submission status: Accepted

Solution code:
A = list(map(int,input().split(" ")))
B = list(map(int,input().split(" ")))
C = list(map(int,input().split(" ")))
max_x = max(B)
min_y = min(C)
X = A[2]
count = -100
Y = A[3]
for i in range(200):
    if X < count <= Y and max_x < count and count <= min_y:
        print("No War")
        exit()
    count += 1
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()))
z = min(y)

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

else:
    print('War')

Submission status: Accepted

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

max_x = max(lstx)
min_y = min(lsty)

for i in range(1,y-x+1):
    z = x+i
    if max_x < z and min_y >= z : 
        ans = "No War"
        break
else:
    ans = "War"

print(ans)

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()))
s=0
X=max(xx)
Y=min(yy)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mx = max(xs)
my = min(ys)

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

Submission status: Accepted

Solution code:
N,M,X,Y=map(int, input().split())
Xpoints=list(map(int, input().split()))
Ypoints=list(map(int, input().split()))
isWar='War'
for z in range(-99, 101):
    if X < z and z <= Y:
        if max(Xpoints) < z:
            if min(Ypoints) >= z:
                isWar = 'No War'
                break

print(isWar)

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

if max(X_list) < min(Y_list) and X < min(Y_list) and max(X_list) < 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()))

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

print('War')

Submission status: Accepted

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

Submission status: Accepted

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

x.sort()
y.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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