ZhenlongDai/ACPR huggingface dataset:
Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))

count=0
for i in range(n):
    m=i
    for j in range(i,n):
        if l[j]<l[m]:
            m=j
    l[i],l[m]=l[m],l[i]
    count+=1
print(*l)
print(count)


Failing test case input:
6
6 4 8 1 1 -1

Expected output:
-1 1 1 4 6 8
4


Actual output:
-1 1 1 4 6 8
6


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))

count=0
for i in range(n):
    m=i
    for j in range(i,n):
        if l[j]<l[m]:
            m=j
    l[i],l[m]=l[m],l[i]
    if l[i]!=l[m]:
        count+=1
print(*l)
print(count)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
A = input().split(' ')
count = 0

for i in range(0, n):
    minj = i

    for j in range(i, n):
        if int(A[j]) < int(A[minj]):
            minj = j
            count += 1

    (A[i], A[minj]) = (A[minj], A[i])

print(" ".join(A))
print(count)

Failing test case input:
6
-1 -1 0 1 -1 -1

Expected output:
-1 -1 -1 -1 0 1
2


Actual output:
-1 -1 -1 -1 0 1
3


Fixed submission (verdict: Accepted):
n = int(input())
A = input().split(' ')
count = 0

for i in range(0, n):
    minj = i

    for j in range(i, n):
        if int(A[j]) < int(A[minj]):
            minj = j

    if i != minj:
        (A[i], A[minj]) = (A[minj], A[i])
        count += 1

print(" ".join(A))
print(count)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
def bubbleSort(A, N):
    s = 0
    for i in range(N):
        minj = i
        for j in range(i,N):
            if A[j] < A[minj]:
                minj = j
                A[j], A[j - 1] = A[j - 1], A[j]
                s += 1
    t = str(A[0])
    for i in range(1,N):
        t = t + " " + str(A[i])
    print(t)
    print(s)

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

bubbleSort(a, n)

Failing test case input:
6
38 44 0 0 0 -2

Expected output:
-2 0 0 0 38 44
5


Actual output:
38 0 -2 0 0 44
6


Fixed submission (verdict: Accepted):
def selectionSort(A, N):
    s = 0
    for i in range(N):
        minj = i
        for j in range(i,N):
            if A[j] < A[minj]:
                minj = j
        A[i], A[minj] = A[minj], A[i]
        if i != minj:
            s += 1
    t = str(A[0])
    for i in range(1,N):
        t = t + " " + str(A[i])
    print(t)
    print(s)

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

selectionSort(a, n)
Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
def selectionSort(A, N): 
    A = A.split(" ")
    change_count = 0
    for i in range(N):
        minj = i
        for j in range(i,N):
            if A[j] < A[minj]:
                minj = j
        if i != minj:
            
            tmp = A[i]
            A[i] = A[minj]
            A[minj] = tmp
            change_count+=1
    
    
    print(" ".join(map(str,A)))
    print(change_count)
    


N = int(input("数列の長さを表す整数を入力して下さい  "))  
A = input("N 個の整数が空白区切りで入力して下さい  ")   
selectionSort(A,N)



Failing test case input:
6
23 60 0 0 1 -3

Expected output:
-3 0 0 1 23 60
5


Actual output:
数列の長さを表す整数を入力して下さい  N 個の整数が空白区切りで入力して下さい  -3 0 0 1 23 60
5


Fixed submission (verdict: Accepted):
def selectionSort(A, N): 
    A = list(map(int, A.split(" ")))
    change_count = 0
    for i in range(N):
        minj = i
        for j in range(i,N):
            if A[j] < A[minj]:
                minj = j
        if i != minj:
            
            tmp = A[i]
            A[i] = A[minj]
            A[minj] = tmp
            change_count+=1
    
    
    print(" ".join(map(str,A)))
    print(change_count)
    


N = int(input())  
A = input("")   
selectionSort(A,N)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
import sys

def selection_sort(nums, n):
    cnt = 0
    
    for i in range(n):
        minj = i
        for j in range(i, n):
            if nums[j] < nums[minj]:
                minj = j

        nums[i], nums[minj] = nums[minj], nums[i]
        cnt += 1

    print(cnt)
    
def main():
    n = int(sys.stdin.readline().strip())
    data = sys.stdin.readline().strip().split(' ')
    nums = [int(i) for i in data]
    selection_sort(nums, n)

if __name__ == '__main__':
    main()
    

Failing test case input:
6
14 70 0 0 0 -2

Expected output:
-2 0 0 0 14 70
5


Actual output:
6


Fixed submission (verdict: Accepted):
import sys

def selection_sort(nums, n):
    cnt = 0
    
    for i in range(n):
        minj = i
        for j in range(i, n):
            if nums[j] < nums[minj]:
                minj = j

        nums[i], nums[minj] = nums[minj], nums[i]
        if i != minj:
            cnt += 1

    print(' '.join([str(i) for i in nums]))
    print(cnt)
    
def main():
    n = int(sys.stdin.readline().strip())
    data = sys.stdin.readline().strip().split(' ')
    nums = [int(i) for i in data]
    selection_sort(nums, n)

if __name__ == '__main__':
    main()
Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
N = int(input())
A = [int(e) for e in input().split()]

def selection_sort(A, N):
    steps = 0
    for i in range(0, N):
        minj = i
        for j in range(i, N):
            if A[minj] > A[j]:
                minj = j
        A[minj], A[i] = A[i], A[minj]
        steps += 1

    print(A)
    print(steps)
    return A

selection_sort(A, N)


Failing test case input:
6
23 60 0 0 0 -3

Expected output:
-3 0 0 0 23 60
5


Actual output:
[-3, 0, 0, 0, 23, 60]
6


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(e) for e in input().split()]

def selection_sort(A, N):
    steps = 0
    for i in range(0, N):
        minj = i
        for j in range(i, N):
            if A[minj] > A[j]:
                minj = j
        if i != minj:
            steps += 1
        A[minj], A[i] = A[i], A[minj]

    for e in A[:-1]:
        print(e, end=' ')
    print(A[-1])
    print(steps)
    return A

selection_sort(A, N)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
def print_list(A):
    print(*A, sep=" ")

def swap(a, b):
    return b, a

def find_minj(A, i, n):
    minj = i
    for j in range(i, n):
        if A[j] < A[minj]:
            minj = j
    return minj

def selection_sort(A, n):
    print_list(A)
    replace_num = 0
    for i in range(0, n):
        minj = find_minj(A, i, n)
        A[i], A[minj] = swap(A[i], A[minj])
        replace_num += 1
    print(replace_num)

n = int(input())
A = list(map(int,input().split()))

selection_sort(A, n)


Failing test case input:
6
14 70 0 0 0 -1

Expected output:
-1 0 0 0 14 70
5


Actual output:
14 70 0 0 0 -1
6


Fixed submission (verdict: Accepted):
def print_list(A):
    print(*A, sep=" ")

def swap(a, b):
    return b, a

def find_minj(A, i, n):
    minj = i
    for j in range(i, n):
        if A[j] < A[minj]:
            minj = j
    return minj

def selection_sort(A, n):
    replace_num = 0
    for i in range(0, n):
        minj = find_minj(A, i, n)
        if A[i] > A[minj]:
            A[i], A[minj] = swap(A[i], A[minj])
            replace_num += 1
    print_list(A)
    print(replace_num)

n = int(input())
A = list(map(int,input().split()))

selection_sort(A, n)
Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):

A = []



LENGTH =int(input())
A = input().split()


i = 0
j = 1
CHANGE = 0

while i <= LENGTH -1 :
    j = i + 1
    mini = i
    while j <= LENGTH -1:
        if int(A[j]) < int(A[mini]) :
            tmp = A[j]
            A[j] = A[mini]
            A[mini] = tmp
            CHANGE += 1
        j += 1
    i += 1
    CHANGE += 1

print(" ".join(map(str,A)))
print (CHANGE)


Failing test case input:
6
38 44 0 0 0 -2

Expected output:
-2 0 0 0 38 44
5


Actual output:
-2 0 0 0 38 44
15


Fixed submission (verdict: Accepted):









A = []



LENGTH =int(input())
A = input().split()


i = 0
CHANGE_COUNT = 0

while i <= LENGTH -1:
    j = i + 1
    mini = i
    while j <= LENGTH -1:
        if int(A[j]) < int(A[mini]) :
            mini = j
        j += 1
    if mini != i:
        tmp = A[i]
        A[i] = A[mini]
        A[mini] = tmp
        CHANGE_COUNT += 1
    i += 1

print(" ".join(map(str,A)))
print (CHANGE_COUNT)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
length = int(input())
eles = [int(l) for l in input().split()]
times = 0

for i in range(length-1):
    _min = i
    for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
    eles[i], eles[_min] = eles[_min], eles[i]
    times += 1

print(*eles)
print(times)

Failing test case input:
6
38 44 0 -1 1 -4

Expected output:
-4 -1 0 1 38 44
4


Actual output:
-4 -1 0 1 38 44
5


Fixed submission (verdict: Accepted):
length = int(input())
eles = [int(l) for l in input().split()]
times = 0

for i in range(length-1):
    _min = i
    for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
    if i != _min:
        eles[i], eles[_min] = eles[_min], eles[i]
        times += 1

print(*eles)
print(times)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

count = 0
for i in range(n):
    mini = a.index(min(a[i:]))
    if mini != i:
        a[i], a[mini] = a[mini], a[i]
        count += 1

print(' '.join(map(str, a)))
print(count)



Failing test case input:
6
5 6 4 4 1 2

Expected output:
1 2 4 4 5 6
2


Actual output:
1 2 4 4 5 6
3


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

count = 0
for i in range(n):
    mini = i + a[i:].index(min(a[i:]))
    if mini != i:
        a[i], a[mini] = a[mini], a[i]
        count += 1

print(' '.join(map(str, a)))
print(count)
Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
A = list(map(int,input().split()))
c = 0
for i in range(n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    t = A[i]
    A[i] = A[minj]
    A[minj] = t
    c += 1
	
print(" ".join(map(str,A)))
print(c)

Failing test case input:
6
-1 -1 0 1 -3 0

Expected output:
-3 -1 -1 0 0 1
4


Actual output:
-3 -1 -1 0 0 1
6


Fixed submission (verdict: Accepted):
n = int(input())
A = list(map(int,input().split()))
c = 0
for i in range(n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        t = A[i]
        A[i] = A[minj]
        A[minj] = t
        c += 1
	
print(" ".join(map(str,A)))
print(c)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):


N = int(input())
a = list(map(int, input().split()))

swapCount = 0
for i in range(0, N):
    minIndex = i
    for j in range(0, N):
        if a[j] < a[minIndex]:
            minIndex = j
    
    if i != minIndex:
        tmp = a[i]
        a[i] = a[minIndex]
        a[minIndex] = tmp
        swapCount += 1

print(' '.join(map(str, a)))
print(swapCount)

        

Failing test case input:
6
5 6 4 4 1 2

Expected output:
1 2 4 4 5 6
2


Actual output:
6 4 4 5 2 1
6


Fixed submission (verdict: Accepted):


N = int(input())
a = list(map(int, input().split()))

swapCount = 0
for i in range(0, N):
    minIndex = i
    for j in range(i, N):
        if a[j] < a[minIndex]:
            minIndex = j
    
    if i != minIndex:
        tmp = a[i]
        a[i] = a[minIndex]
        a[minIndex] = tmp
        swapCount += 1

print(' '.join(map(str, a)))
print(swapCount)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):

def selectionSort(A,N):
    c=0
    for i in range(N):
        minj = i
        j=i
        while j<N:
            if(int(A[j])<int(A[minj])):
                minj = j
            j+=1
        A[i],A[minj]=A[minj],A[i]
        c+=1
    return c

N=int(input())
A=input().split()
c=selectionSort(A,N)
S=""
for i in range(N-1):
    S+=A[i]+" "
S+=str(A[-1])
print(S)
print(c)

Failing test case input:
6
-1 -1 0 1 -1 -1

Expected output:
-1 -1 -1 -1 0 1
2


Actual output:
-1 -1 -1 -1 0 1
6


Fixed submission (verdict: Accepted):

def selectionSort(A,N):
    c=0
    for i in range(N):
        minj = i
        j=i
        while j<N:
            if(int(A[j])<int(A[minj])):
                minj = j
            j+=1
        if(i!=minj):
            A[i],A[minj]=A[minj],A[i]
            c+=1
    return c

N=int(input())
A=input().split()
c=selectionSort(A,N)
S=""
for i in range(N-1):
    S+=A[i]+" "
S+=str(A[-1])
print(S)
print(c)
Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
cnt = 0
chge = 0
for i in range(N):
    mn = A[i]
    for j in range(i+1, N):
        print(mn, A[j])
        if mn > A[j]:
            mn = A[j]
            chge = 1
    if chge:
        idx = A.index(mn)
        A[idx] = A[i]
        A[i] = mn
        cnt += 1
        chge = 0

    for i in range(N):
        if i == N - 1:
            print(A[i])
        else:
            print(str(A[i]), end = " ")
print(cnt)

Failing test case input:
6
4 35 0 1 0 -1

Expected output:
-1 0 0 1 4 35
4


Actual output:
4 35
4 0
0 1
0 0
0 -1
-1 35 0 1 0 4
35 0
0 1
0 0
0 4
-1 0 35 1 0 4
35 1
1 0
0 4
-1 35 0 1 0 4
1 0
0 4
-1 35 1 0 0 4
0 4
-1 35 1 0 0 4
-1 35 1 0 0 4
4


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
cnt = 0
chge = 0
for i in range(N):
    mn = A[i]
    for j in range(i+1, N):
        if mn > A[j]:
            mn = A[j]
            idx = j
            chge = 1
    if chge:
        A[idx] = A[i]
        A[i] = mn
        cnt += 1
        chge = 0

for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print(str(A[i]), end = " ")
print(cnt)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
b=0
for i in a:
    minj=i
    for j in range(i,n-1):
        if a[minj]>a[j]:
            a[minj],a[j]=a[j],a[minj]
            minj=j
            b+=1
print(*a)
print(b)


Failing test case input:
6
5 3 2 3 -1 3

Expected output:
-1 2 3 3 3 5
3


Actual output:
5 3 -1 2 3 3
2


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
b=0
for i in range(n):
    minj=i
    for j in range(i,n):
        if a[minj]>a[j]:
            minj=j
    if i!=minj:
        a[i],a[minj]=a[minj],a[i]
        b+=1
print(*a)
print(b)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
A = input().split(' ')
count = 0

for i in range(0, n):
    minj = i

    for j in range(i, n):
        if A[j] < A[minj]:
            minj = j
            count += 1

    (A[i], A[minj]) = (A[minj], A[i])

print(" ".join(A))
print(count)

Failing test case input:
6
6 4 8 1 1 -1

Expected output:
-1 1 1 4 6 8
4


Actual output:
-1 1 1 4 6 8
7


Fixed submission (verdict: Accepted):
n = int(input())
A = input().split(' ')
count = 0

for i in range(0, n):
    minj = i

    for j in range(i, n):
        if int(A[j]) < int(A[minj]):
            minj = j

    if i != minj:
        (A[i], A[minj]) = (A[minj], A[i])
        count += 1

print(" ".join(A))
print(count)
Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
length = int(input())
eles = [int(l) for l in input().split()]
times = 0

for i in range(length-1):
    _min = i
    for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
    if i != _min:
        eles[i], eles[_min] = eles[_min], eles[i]
        times += 1

print(times)
print(*eles)

Failing test case input:
6
6 18 4 1 1 -1

Expected output:
-1 1 1 4 6 18
5


Actual output:
5
-1 1 1 4 6 18


Fixed submission (verdict: Accepted):
length = int(input())
eles = [int(l) for l in input().split()]
times = 0

for i in range(length-1):
    _min = i
    for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
    if i != _min:
        eles[i], eles[_min] = eles[_min], eles[i]
        times += 1

print(*eles)
print(times)

Problem: p02260
Buggy submission (Python3, verdict: Wrong Answer):
def selection_sort(a,n):
    count=0
    for i in range(n):
        ch=False
        minj=i
        for j in range(i,n):
            if a[j] < a[minj]:
                minj = j
                ch = True
        if(ch):
            count+=1
        a[i],a[minj] = a[minj],a[i]
    return count

if __name__ == "__main__":
    n=int(input())
    a=list(map(int,input().split()))
    count=selection_sort(a,n)
    for i in a:
        if i != a[-1]:
            print(i,end=" ")
        else:
            print(i)
    print(count)


Failing test case input:
6
-2 -2 0 -2 0 -2

Expected output:
-2 -2 -2 -2 0 0
2


Actual output:
-2 -2 -2 -2 0
0
2


Fixed submission (verdict: Accepted):
def selection_sort(a,n):
    count=0
    for i in range(n):
        ch=False
        minj=i
        for j in range(i,n):
            if a[j] < a[minj]:
                minj = j
                ch = True
        if(ch):
            count+=1
        a[i],a[minj] = a[minj],a[i]
    return count

if __name__ == "__main__":
    n=int(input())
    a=list(map(int,input().split()))
    count=selection_sort(a,n)
    print(*a)
    print(count)
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y=map(int,input().split())
x=map(int,input().split())
y=map(int,input().split())
z1=max(x)
z2=min(y)

print('No War' if X<z1<=z2<Y else 'War')

Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N,M,X,Y=map(int,input().split())
x=map(int,input().split())
y=map(int,input().split())
z1=max(x)
z2=min(y)

print('No War' if min(z2,Y)>max(z1,X) else 'War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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('War')
else:
  print('No War')



Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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)+1)>min(y) or (X+1)>Y):
  print('War')
else:
  print('No War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[-1] <= ylist[0]:
   for i in range(xlist[-1]+1, ylist[0]+1):
      if X < i and i <= Y:
          print("No War")
          break
else:
   print("War")


Failing test case input:
5 3 6 8
-10 0 1 5 -100
101 6 14

Expected output:
War


Actual output:

Fixed submission (verdict: Accepted):
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.append(X)
ylist.append(Y)
xlist.sort()
ylist.sort()
xlist.reverse()

if xlist[0] < ylist[0]:
   print("No War")
else:
   print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x,y = map(int,input().split())
xarr = list(map(int,input().split()))
yarr = list(map(int,input().split()))

xarr.sort(reverse=True)
yarr.sort()

if x+1 >= y or xarr[0] >= yarr[0] or xarr[0] >= y or yarr[0] <= x:
    print('war')
else:
    print('no war')



Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
war


Fixed submission (verdict: Accepted):
n,m,x,y = map(int,input().split())
xarr = list(map(int,input().split()))
yarr = list(map(int,input().split()))

xarr.sort(reverse=True)
yarr.sort()

if x+1 >= y or xarr[0] >= yarr[0] or xarr[0] >= y or yarr[0] <= x:
    print('War')
else:
    print('No War')
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if min(y)-max(x) < 1 and Y-X <= 1:
  print("War")
else:
  print("No War")

Failing test case input:
4 2 -55 -1
-20 -14 -35 -146
-22 75

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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 min(y) >= max(x)+1:
  print("No War")
else:
  print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X, Y = map(int, input().split())
x = max(map(int, input().split()))
y = min(map(int, input().split()))
print("No War"if x <= y and x < Y and X <= y else "War")

Failing test case input:
5 3 6 8
-10 3 1 5 -100
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N, M, X, Y = map(int, input().split())
x = max(map(int, input().split()))
y = min(map(int, input().split()))
print("No War"if x < y and x < Y and X < y else "War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

flag = 0

l = list(range(max(x), min(y)+1))

for i in l:
  if X < i and i <= Y:
    flag = 1

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

Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
 
flag = 0
 
l = list(range(max(x)+1, min(y)+1))
 
for i in l:
  if X < i and i <= Y:
    flag = 1
    
if max(x) >= min(y):
  print('War')
elif flag == 0:
  print('War')
else:
  print('No War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x,y = map(int,input().split())

x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))

if max(x_li) > min(y_li):
    print('War')
else:
    if x < min(y_li) and y > max(x_li):
        if x in y_li or y in x_li:
            print('No War')
    else:
        print('War')


Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:

Fixed submission (verdict: Accepted):
n,m,x,y = map(int,input().split())

x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))

flag = 0
for i in range(x+1,y+1):
    if max(x_li) < i:
        if min(y_li) >= i:
            flag = 1

print(['War','No War'][flag])
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n,m,x,y=map(int,input().split())
lx=list(map(int,input().split()))
ly=list(map(int,input().split()))
lx.sort()
ly.sort()
if lx[n-1]>ly[0] or ly[0]<=x or ly[0]>y:
    print('War')
    sys.exit()
else:print('No War')

Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
import sys
n,m,x,y=map(int,input().split())
lx=list(map(int,input().split()))
ly=list(map(int,input().split()))
lx.sort()
ly.sort()
if lx[n-1]>=ly[0] or ly[0]<=x or ly[0]>y:
    print('War')
    sys.exit()
else:print('No War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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(-100,101):
    if X <= i <= Y and x_max < i and y_min >= i:
        print("No War")
        print(i)
        exit()
print("War")

Failing test case input:
0 0 10 40
12 1 15
16 37

Expected output:
No War


Actual output:
No War
16


Fixed submission (verdict: Accepted):
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(-100,101):
    if X < i <= Y and x_max < i and y_min >= i:
        print("No War")
        exit()
print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = max(A)
b = min(B)


if a-b <= 0 and (X+1 < a+1 or b <= Y):
  print('No War')
else:
  print('War')

Failing test case input:
5 3 6 8
-10 3 1 5 -100
100 6 14

Expected output:
War

Actual output:
No War


Fixed submission (verdict: Accepted):
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
x = max(X,max(A))
y = min(Y,min(B))
 
if Y >= x and y > X and y > x:
  print('No War')
else:
  print('War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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)

z_1 = list(range(X+1, Y+1))
z_2 = list(range(x_max+1, y_min+1))

if z_1 and z_2:
    print("No War")
else:
    print("War")



Failing test case input:
5 5 6 8
-1 0 1 5 -264
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):


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

if y_min - x_max > 0:
    print("No War")
else:
    print("War")
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x, y = list(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 max_x < (min_y-1):
    print('No War')
else:
    print('War')

Failing test case input:
3 2 10 40
8 11 15
16 22

Expected output:
No War


Actual output:
War


Fixed submission (verdict: Accepted):
n, m, x, y = list(map(int, input().split()))

x_ = list(map(int, input().split()))
y_ = list(map(int, input().split()))

if max(x_) > x:
    max_x = max(x_)
else:
    max_x = x

if min(y_) > y:
    min_y = y
else:
    min_y = min(y_)


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

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
tmp = list(range(X,Y+1))
tmp2 = list(range(max(x),min(y)+1))
if list(set(tmp) & set(tmp2)) == []:
  print('War')
else:
  print('No War')

Failing test case input:
5 5 6 8
-1 0 1 5 -76
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
tmp = list(range(X+1,Y+1))
tmp2 = list(range(max(x)+1,min(y)+1))
if list(set(tmp) & set(tmp2)) == []:
  print('War')
else:
  print('No War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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(reverse = True)
y.sort()
print(x[0],y[0])
if x[0]<y[0]:
    print('No War')
else:
    print('War')

Failing test case input:
5 5 6 8
-1 0 0 5 -138
111 6 2

Expected output:
War


Actual output:
6 2
War


Fixed submission (verdict: Accepted):
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(reverse = True)
y.sort()

if x[0]<y[0]:
    print('No War')
else:
    print('War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = map(int, input().split())

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

Failing test case input:
5 5 6 8
-1 0 1 5 -138
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N,M,X,Y = map(int, input().split())

x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
x_tmp = max(x[-1], X)
y_tmp = min(y[0], Y)
print('No War' if x_tmp < y_tmp else 'War')
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
flag = 0
a = max(A)
b = min(B)
for i in range(X+1,Y) :
    if i >= max(A) and i <= Y and i <= min(B) and i > X :
        flag += 1
if flag >= 1 :
    print("No War")
else :
    print("War")
    

Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
flag = 0
a = max(A)
b = min(B)
for i in range(X+1,Y) :
    if i > max(A) and i <= Y and i <= min(B) and i > X :
        flag += 1
if flag >= 1 :
    print("No War")
else :
    print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

if X+1>Y:
    print("War")
else:
    if max(x)+1 >min(y):
        print("War")
    else:
        print("No War")

Failing test case input:
5 5 6 8
-1 0 1 5 -264
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

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

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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] < 0:
    Z = x[-1] - 1
else:
    Z = x[-1] + 1

if Z > y[0]:
    print("War")
elif Z < X:
    print("War")
elif Z >= Y:
    print("War")
else:
    print("No War")


Failing test case input:
5 5 6 8
-1 0 1 5 -138
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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):
    Z = max(x) + 1

else:
    print("War")
    exit()

if X < Z and Z <= Y:
    print("No War")

else:
    print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    for t in range(X + 1, Y + 1):
        if max(x + [t]) == t and min(y + [t]) == t:
            print('No War')
            exit()
    print('War')


main()


Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
def main():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    for t in range(X + 1, Y + 1):
        if t > max(x) and min(y) >= t:
            print('No War')
            exit()
    print('War')


main()
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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):
    for i in range(max(x),min(y)+1):
        if max(x) < i <= min(y):
             print("No War")
             break
print("War")
             


Failing test case input:
0 2 10 27
8 15 15
16 22

Expected output:
No War


Actual output:
No War
War


Fixed submission (verdict: Accepted):
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, Y+1):
  if X < i <= Y and max(x) < i <= min(y):
    print("No War")
    exit()
print("War")

Problem: p03251
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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")


Failing test case input:
5 2 6 8
-1 0 1 5 -100
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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


Failing test case input:
5 3 6 8
-10 3 1 5 -100
100 3 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):

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

    ok = False
    for z in range(X+1,Y+1):
        if z > max(x_s) and z <= min(y_s):
            ok = True
            break

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


if __name__ == '__main__':
    main()

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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(-101, 102):
    if X < z <= Y and x_max <= z and y_min >= z:
        print("No War")
        break
else:
    print("War")


Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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(-99, 101):
    if X < z <= Y and x_max < z and y_min >= z:
        print("No War")
        break
else:
    print("War")
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x,y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
z='No War' if max(x)<min(y) else 'War'
print(z)


Failing test case input:
5 5 6 8
-1 0 1 5 -264
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
z='No War' if max(x)<min(y) and X<min(y) and min(y)<=Y else 'War'
print(z)

Problem: p03251
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
if __name__ == '__main__':
	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 x_max < Z <= y_min:
			flg = True
			print("No war")
			exit()
	print("War")
 

Failing test case input:
3 2 10 40
8 1 15
16 23

Expected output:
No War


Actual output:
No war


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
	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)

	flg = False
	for Z in range(X+1,Y+1):
		if x_max < Z <= y_min:
			flg = True
			break

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

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
5 5 6 8
-1 0 1 5 -76
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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 max_x<X:
    max_x=X
if min_y>Y:
    min_y=Y
if min_y<=max_x:
    print("War")
else:
    print("No War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')

Failing test case input:
5 5 8 8
-1 0 1 5 -264
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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')

Problem: p03251
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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")


Failing test case input:
5 3 6 8
-10 0 1 5 -100
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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")
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = list(map(int,input().split()))

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

if  max_x > min_y:
	print('War')
else:
    print('No War')

Failing test case input:
5 5 6 8
-1 0 1 5 -76
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N,M,X,Y = list(map(int,input().split()))

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

if  max_x >= min_y:
	print('War')
elif X >= min_y:
    print('War')
elif Y <= max_x:
    print('War')
else:
    print('No War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input()
a=max(list(map(int,input().split())))
b=min(list(map(int,input().split())))
print("War" if a>b else "No War")

Failing test case input:
5 3 6 8
-10 0 1 5 -100
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,a,b=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
if a<max(x)<=min(y)<=b:
    print("No War")
else:
    print("War")

Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
n,m,a,b=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
j=False
for i in range(a+1,b+1):
    if max(x)<i and min(y)>=i:
        j=True

print("No War" if j else "War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x,y = [int(i) for i in input().split()]
xs = [int(i) for i in input().split()]
ys = [int(i) for i in input().split()]
if max(xs) < min(ys):
    print("No War")
else:
    print('War')

Failing test case input:
5 3 6 8
-1 0 2 5 -100
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
n,m,x,y = [int(i) for i in input().split()]
xs = [int(i) for i in input().split()]
ys = [int(i) for i in input().split()]
if max(xs) < min(ys):
    if x < min(ys) <= y:
        print("No War")
    else:
        print("War")
else:
    print('War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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 else "War")


Failing test case input:
5 5 6 8
-1 0 1 5 -138
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):

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")
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = max(A)
b = min(B)
 
if (Y >= a and b > X) and b >= a:
  print('No War')
else:
  print('War')

Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
x = max(X,max(A))
y = min(Y,min(B))
 
if Y >= x and y > X and y > x:
  print('No War')
else:
  print('War')

Problem: p03251
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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")

Failing test case input:
3 2 10 27
8 15 15
16 22

Expected output:
No War


Actual output:
NO War


Fixed submission (verdict: Accepted):
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")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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 max_x <= min_y and (X <= max_x <= Y or X <= min_y <= Y ):
	print('No War')
else:
	print('War')

Failing test case input:
5 3 6 8
-1 0 1 5 -100
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x, y = map(int, input().split())
areaX = list(map(int, input().split()))
areaY = list(map(int, input().split()))

maxX = max(areaX)
minY = min(areaY)

if maxX < minY:
    print("No War")
else:
    print("War")

Failing test case input:
5 3 6 8
-10 0 1 5 -100
101 6 14

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
n, m, x, y = map(int, input().split())
areaX = list(map(int, input().split()))
areaY = list(map(int, input().split()))

areaX.append(x)
areaY.append(y)

if max(areaX) < min(areaY):
    print("No War")
else:
    print("War")
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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()
print(y)

print(x)

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


Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
[11, 16]
[8, 9, 11]
War


Fixed submission (verdict: Accepted):
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)
x.sort()
y.sort()

if x[N] < y[0]:
    print("No War")
else:
    print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X,Y = map(int, input().split(" "))
xList = input().split(" ")
yList = input().split(" ")

for i in range(len(xList)):
  xList[i] = int(xList[i])
for j in range(len(yList)):
  yList[j] = int(yList[j])

xList.sort()
yList.sort()

if yList[0] - 1 > xList[len(xList) - 1]:
  print("No War")
else:
  print("War")

Failing test case input:
3 2 10 40
8 1 15
16 22

Expected output:
No War


Actual output:
War


Fixed submission (verdict: Accepted):
N,M,X,Y = map(int, input().split(" "))
xList = input().split(" ")
yList = input().split(" ")

for i in range(len(xList)):
  xList[i] = int(xList[i])
for j in range(len(yList)):
  yList[j] = int(yList[j])

xList.sort()
yList.sort()

if yList[0] > xList[len(xList) - 1] and yList[0] > X and Y > xList[len(xList) - 1]:
  print("No War")
else:
  print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, M, X, Y = map(int, input().split())
x = map(int, input().split())
y = map(int, input().split())

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

Failing test case input:
4 2 -48 -1
-20 -7 -35 -79
-22 75

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
H, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
 
r = any(all(i < z for i in x) and all(i >= z for i in y) for z in range(X+1, Y+1))
print("No War" if r else "War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) > min(l[1]) or x >= max(l[0]) or min(l[1]) > y:
    print('War')
else:
    print('No War')

Failing test case input:
3 2 10 40
8 11 9
16 11

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if min(l[1]) - max(l[0])> 0 and max(l[0]) < y and x < min(l[1]):
    print('No War')
else:
    print('War')
Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x,y = [int(i) for i in input().split()]

xl = [int(i) for i in input().split()]
yl = [int(i) for i in input().split()]

x_max = max(xl)
y_min = min(yl)
z = {i for i in range(x,y+1)}
x_y_interval = {i for i in range(x_max+1,y_min+1)} 


if y_min <= x_max:
    print('War')
elif list(z &x_y_interval):
    print('No war')
else:
    print('War')

Failing test case input:
5 5 6 8
-1 0 1 5 -264
101 6 26

Expected output:
War


Actual output:
No war


Fixed submission (verdict: Accepted):
n,m,x,y = [int(i) for i in input().split()]

xl = [int(i) for i in input().split()]
yl = [int(i) for i in input().split()]

x_max = max(xl)
y_min = min(yl)
z = {i for i in range(x+1,y+1)}
x_y_interval = {i for i in range(x_max+1,y_min+1)} 


if not x_y_interval:
    print('War')
elif z &x_y_interval:
    print('No War')
else:
    print('War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')
  

Failing test case input:
5 5 6 8
-1 0 1 5 -138
101 6 26

Expected output:
War


Actual output:
No War


Fixed submission (verdict: Accepted):
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 Z <= min(y):
    print('No War')
else:
    print('War')

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, x, y = [list(map(int, input().split()))for i in range(3)]
if max(a[2], sorted(x)[-1])<min(a[3],sorted(y)[0]): print("No war")
else: print("War")

Failing test case input:
3 0 10 40
8 1 15
16 23

Expected output:
No War


Actual output:
No war


Fixed submission (verdict: Accepted):
a, x, y = [list(map(int, input().split()))for i in range(3)]
if max(a[2], sorted(x)[-1])<min(a[3],sorted(y)[0]): print("No War")
else: print("War")

Problem: p03251
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X, Y = map(int, input().split())
xmax = max(map(int, input().split() + [X]))
ymin = min(map(int, input().split() + [Y]))

if xmax < ymin:
    print("No war")
else:
    print("war")

Failing test case input:
5 5 6 8
-1 -1 1 5 -298
101 6 2

Expected output:
War


Actual output:
war


Fixed submission (verdict: Accepted):
N, M, X, Y = map(int, input().split())
xmax = max(map(int, input().split() + [X]))
ymin = min(map(int, input().split() + [Y]))
 
if xmax < ymin:
    print("No War")
else:
    print("War")