Harryxun/stf_run huggingface dataset:
n, s = map(int, raw_input().split())
xs = [ int(i) for i in raw_input().split()]

diff = [ abs(x-s) for x in xs]

divisors = []
target = min(diff)
while True:
    if target > max(diff):
        break
    if all([d % target == 0  for d in diff]):
        divisors.append(target)
    target += 1

print(max(divisors))


### FIXED CODE ###

from fractions import gcd
n, s = map(int, raw_input().split())
xs = [ int(i) for i in raw_input().split()]
diff = [ abs(x-s) for x in xs]
print(reduce(gcd, diff))
a = list(map(int,input().split()))
ans = sum(a)
if a >= 22:
  ans = "burst"
else:
  ans = "win"
print(ans)

### FIXED CODE ###

a = list(map(int,input().split()))
ans = sum(a)
if ans >= 22:
  ans = "bust"
else:
  ans = "win"
print(ans)
import fractions

def f(x, c, d):
    lcm_num = c*d / fractions.gcd(c, d)
    return x - x//c - x//d + x//lcm_num

a, b, c, d = map(int, input().split())

print(f(b) - f(a-1))

### FIXED CODE ###

import fractions

def f(x, c, d):
    lcm_num = c*d // fractions.gcd(c, d)
    return x - x//c - x//d + x//lcm_num

a, b, c, d = map(int, input().split())
print(int(f(b, c, d) - f(a-1, c, d)))
from math import gcd
X, Y = map(int, input().split())
if X % Y == 0:
    print(-1)
else:
    print(X)

### FIXED CODE ###

X, Y = map(int, input().split())
if X % Y == 0:
    print(-1)
else:
    print(X)
a,b,x= map(int, input().split())
xb = b//x
xa = a//x
if a % x ==0:
    tx = 1

print(int(xb-xa+tx))

### FIXED CODE ###

a,b,x= map(int, input().split())
tx =0
xb = b//x
xa = a//x
if a % x ==0:
    tx = 1

print(int(xb-xa+tx))
import math
n = int(input())
d = list(map(int, input().split()))
b = 1
ans = 1
maxd = max(d)
if d[0] == 0 and d.count(0) == 1:
    for i in range(1, maxd+1):
        dc = d.count(i)
        if dc == 0:
            print(0)
            exit()
        ans *= math.pow(b, dc)
        b = dc
    print(ans % 998244353)
else:
    print(0)

### FIXED CODE ###

n = int(input())
d = list(map(int, input().split()))
b = 1
ans = 1
max = 0
dd=[0]*10**5
for i in d:
    dd[i]+=1
    if(max<i):
        max=i
if d[0] == 0 and d.count(0) == 1:
    for i in range(1, max+1):
        if dd[i] == 0:
            print(0)
            exit()
        if dd[i] == 1:
            ans *= b
        else:
            if b != 1:
                ans *= pow(b, dd[i], 998244353)
        b = dd[i]
    print(ans % 998244353)
else:
    print(0)
if s[-1] == 's':      
    s += 'es'                                                                                                 
else:      
    s += 's'      
print(s) 

### FIXED CODE ###

s = input()                                                                                                   
if s[-1] == 's':
    s += 'es'
else:
    s += 's'      
print(s)
s = input()

slist = s.split(' ')

left = slist[0] + slist[1]

right = slist[2] + slist[3]

if left > right:
	print('left')
else if left == right:
	print('Balanced')
else:
	print('right)

### FIXED CODE ###

s = input()

slist = s.split(" ")

left = int(slist[0]) + int(slist[1])

right = int(slist[2]) + int(slist[3])

if left > right:
	print("Left")
	
elif left == right:
	print("Balanced")
	
else:
	print("Right")
def main():
    X, N = map(int, input().split())
    if N == 0:
        print(X)
        return

    P = list(map(int, input().split()))

    P_exist = [False] * (101)
    for p in P:
        P_exist[p] = True

    if not P_exist[X]:
        print(X)
        return
    
    for i in range(1, 200):
        if (not P_exist[X-i]) and (not P_exist[X+i]):
            print(X-i)
            return
        if not P_exist[X-i]:
            print(X-i)
            return
        if not P_exist[X+i]:
            print(X+i)
            return

main()


### FIXED CODE ###

def main():
    X, N = map(int, input().split())
    if N == 0:
        print(X)
        return

    P = list(map(int, input().split()))

    if not X in P:
        print(X)
        return
    
    for i in range(1, 10000):
        if not X-i in P:
            print(X-i)
            return
        if not X+i in P:
            print(X+i)
            return

main()
a, b, t = (int(i) for i in input())

times = int(t / a)

num = times * b

print(num)


### FIXED CODE ###

a, b, t = (int(i) for i in input().split())
 
times = int(t / a)
 
num = times * b
 
print(num)
A, B, C, D = input().split(' ')
A, B, C, D = int(A), int(B), int(C), int(D)
 
print(min(min(D, B) - max(C, A), 0)

### FIXED CODE ###

A, B, C, D = input().split(' ')
A, B, C, D = int(A), int(B), int(C), int(D)

if B < C or D < A:
    print(0)
else:
    print(min(D, B) - max(C, A))
import sys
import fractions
n,m=map(int,input().split())
A=list(map(int,input().split()))
A=list(map(lambda x: x//2, A))

def dev2(x):
    c=0
    while x%2==0:
        x=x//2
        c+=1
    return c

def lcm(a,b):
    return a*b//fractions.gcd(a,b)

if n==1:
    if l<=m:
        print(int((m/l+1)/2))
    else:
        print(0)
else:
    d=dev2(A[0])
    for i in range(n-1):
        if dev2(A[i+1]) != d:
            print(0)
            sys.exit()     
    for i in range(n-1):
        l=lcm(A[i],A[i+1])
        if l>m:
            print(0)
            sys.exit()
    print(int((m/l+1)/2))

### FIXED CODE ###

import sys
import fractions
n,m=map(int,input().split())
A=list(map(int,input().split()))
A=list(map(lambda x: x//2, A))

def dev2(x):
    c=0
    while x%2==0:
        x=x//2
        c+=1
    return c

def lcm(a,b):
    return a*b//fractions.gcd(a,b)

if n==1:
    if A[0]<=m:
        print(int((m/A[0]+1)/2))
    else:
        print(0)
else:
    d=dev2(A[0])
    for i in range(n-1):
        if dev2(A[i+1]) != d:
            print(0)
            sys.exit()
    l=A[0]
    for i in range(n-1):
        l=lcm(l,A[i+1])
        if l>m:
            print(0)
            sys.exit()
    print(int((m/l+1)/2))
h=int(input())
n=int(input())
l = [int(input()) for i in range(n)]
  
if sum(l)>=h:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

h, n = map(int, input().split())
a = list(map(int, input().split()))
at = sum(a)
 
if at >= h:
    print("Yes")
else:
    print("No")
n = int(input())
v = map(int, input().split())
c = map(int, input().split())
max_val = 0
for _v, _c in zip(v, c):
  if _v - _c > 0:
    max_val += _v - _c
print(max_val

### FIXED CODE ###

n = int(input())
v = map(int, input().split())
c = map(int, input().split())
max_val = 0
for _v, _c in zip(v, c):
  if _v - _c > 0:
    max_val += _v - _c
print(max_val)
x=list(map(int,input().split()))
a,b= x[0],x[1]
print(str(a//b)+" "+str(a%b)+" {0:06f}.format(a/b)"

### FIXED CODE ###

x=list(map(int,input().split()))
a,b= x[0],x[1]
print(str(a//b)+" "+str(a%b)+" {0:06f}".format(a/b))
n,a,b = map(int, input().split())

sum_num = a + b
times = n // sum_num
amari = n % sum_num
if amari >= a:
    print(times * a + amari)
elif:
    print(times * a + a)
    

### FIXED CODE ###

n,a,b = map(int, input().split())

sum_num = a + b
times = n // sum_num
amari = n % sum_num

ans = times * a
if amari <= a:
    ans += amari
else :
    ans += a

print(ans)
R, C, K = map(int, input().split())
goods = [[0] * C for _ in range(R)]
for _ in range(K):
    r, c, v = map(int, input().split())
    goods[r-1][c-1] = v

dp = [[[0] * 4 for _ in range(C)] for _ in range(R)]
dp[0][0][1] = goods[0][0]
for i in range(R):
    for j in range(C):
        if i < R - 1:
            dp[i+1][j][0] = max(dp[i+1][j][0], max(dp[i][j]))
            dp[i+1][j][1] = max(dp[i+1][j][1], max(dp[i][j]) + goods[i+1][j])
        
        if j < C - 1:
            for k in range(4):
                dp[i][j+1][k] = max(dp[i][j+1][k], dp[i][j][k])
            for k in range(3):
                dp[i][j+1][k+1] = max(dp[i][j+1][k+1], dp[i][j][k] + goods[i][j+1])

print(max(dp[R-1][C-1]))R, C, K = map(int, input().split())
goods = [[0] * C for _ in range(R)]
for _ in range(K):
    r, c, v = map(int, input().split())
    goods[r-1][c-1] = v

dp = [[[0] * 4 for _ in range(C)] for _ in range(R)]
dp[0][0][1] = goods[0][0]
for i in range(R):
    for j in range(C):
        if i < R - 1:
            dp[i+1][j][0] = max(dp[i+1][j][0], max(dp[i][j]))
            dp[i+1][j][1] = max(dp[i+1][j][1], max(dp[i][j]) + goods[i+1][j])
        
        if j < C - 1:
            for k in range(4):
                dp[i][j+1][k] = max(dp[i][j+1][k], dp[i][j][k])
            for k in range(3):
                dp[i][j+1][k+1] = max(dp[i][j+1][k+1], dp[i][j][k] + goods[i][j+1])

print(max(dp[R-1][C-1]))

### FIXED CODE ###

R, C, K = map(int,input().split())
MAP = [[0 for i in range(C)] for j in range(R)]
DP = [[[0 for i in range(C+1)] for j in range(4)] for k in range(R+1)]
 
for _ in range(K):
    r, c, v = map(int,input().split())
    MAP[r-1][c-1] = v
 
for i in range(R):
    for j in range(4):
        for k in range(C):
            DP[i+1][j][k+1] = max(DP[i][3][k+1], DP[i+1][j][k])
            if j == 0:
                continue
            v = MAP[i][k]
            if v == 0:
                continue
            DP[i+1][j][k+1] = max(DP[i+1][j][k+1], max(DP[i][3][k+1], DP[i+1][j-1][k]) + v)

print(DP[R][3][C])
s=input()[::-1]

phrase=("dream"[::-1],
        "dreamer"[::-1],
        "erase"[::-1],
        "eraser"[::-1])


def dayDream(word):
    if word[:7] in phrase:
        return dayDream(word[7:])
    elif word[:6] in phrase:
        return dayDream(word[6:])
    elif word[:5] in phrase:
        return dayDream(word[5:])
    
    if len(word)==0:
        return True
    else:
        return False

print("YES") if dayDream(s) else print("NO")

### FIXED CODE ###

s=input()[::-1]

isOk=False
while len(s)>=5:
    if s[:5]=="maerd" or s[:5]=="esare":
        s=s[5:]
    elif len(s)>=6 and s[:6]=="resare":
        s=s[6:]
    elif len(s)>=7 and s[:7]=="remaerd":
        s=s[7:]
    else:
        break
    
    if len(s)==0:
        isOk=True

print("YES") if isOk else print("NO")
n,m=map(int,input().split())
a=[0]*n
for i in range(m):
	a[int(input())]=1

num=[1,1,2]

mod=1000000007

count=0
jud=1
ans=1
for i in range(n+1):
	
	if i>2:
		num.append(1)
		num[i]=(num[i-1]+num[i-2])%mod

	if(jud==0 and a[i]==1):
		print("0")
		break
	elif(i==n):
		count+=1
		ans=(ans%mod)*(num[count-1]%mod)
		
		print(ans%mod)
	elif a[i]==1:
		
		ans=(ans%mod)*(num[count-1]%mod)
		count=0
		jud=0
	else:
		jud=1
		count+=1

### FIXED CODE ###

n,m=map(int,input().split())
a=[0]*(n+1)
for i in range(m):
	a[int(input())]=1


num=[1,1,2]


mod=1000000007

count=0
jud=1
ans=1
for i in range(n+1):
	
	if i>2:
		num.append(1)
		num[i]=(num[i-1]+num[i-2])%mod

	if(jud==0 and a[i]==1):
		print("0")
		break
	elif a[i]==1:
		ans=(ans%mod)*(num[count-1]%mod)
		count=0
		jud=0
	elif(i==n):
		count+=1
		ans=(ans%mod)*(num[count-1]%mod)
		print(ans%mod)
	else:
		jud=1
		count+=1
list=[1,2,3]
for i in range(2):
    list.pop(int(input())-1)
print(list[-1])

### FIXED CODE ###

# coding: utf-8
# Your code here!
# coding: utf-8
from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe


# my functions here!
#標準エラー出力
def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)






def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
#入力（後でいじる）
        
#input
def resolve():
    A=[0,1,2,3]
    A[int(input())]=0
    A[int(input())]=0
    print(sorted(A)[-1])
    #print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
#if __name__=="__main__":resolve()
"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""

import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """3
1"""
        output = """2"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1
2"""
        output = """3"""
        self.assertIO(input, output)

if __name__=="__main__":resolve()
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]

for i in range(N):
  a.append(a[i] + A[i])
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N+1):
  if a[i] > K:
    break
  while b[i] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)
  

### FIXED CODE ###

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]

for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N+1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)
#import math
#import bisect
#import numpy as np
#import itertools
#import copy
import sys

input = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    s = input()
    w = {'Sunny': 'Cloudy', 'Cloudy': 'Rainy', 'Rainy': 'Sunny'}
    print(w[s])

if __name__ == '__main__':
    main()

### FIXED CODE ###

#import math
#import bisect
#import numpy as np
#import itertools
#import copy
import sys

input = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    s = input().rstrip('\n')
    w = {'Sunny': 'Cloudy', 'Cloudy': 'Rainy', 'Rainy': 'Sunny'}
    print(w[s])

if __name__ == '__main__':
    main()
n=int(input())
a=list(map(int,input().split()))
aSet=list(set(a))
if n%3!=0:
    if len(aSet)==1 and aSet[0]=0:
        print('Yes')
    else:
        print('No')
else:
    if len(aSet)==3:
        if (aSet[0]^aSet[1])==aSet[2]:
            print('Yes')
    elif len(aSet)<3:
        if 0 in aSet:
            print('Yes')
    else:
        print('No')


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
aDict={}
for key in set(a):
    aDict[key]=0
for ai in a:
    aDict[ai]+=1

canPuton=False
if len(aDict)==1:
    if 0 in aDict.keys():
        canPuton=True

elif len(aDict)==2:
    if 0 in aDict.keys():
        if n%3==0:
            canPuton=True
            for key in aDict:
                if key==0:
                    if aDict[key]!=n//3:
                        canPuton=False
                else:
                    if aDict[key]!=2*n//3:
                        canPuton=False

elif len(aDict)==3:
    a,b,c=aDict.keys()
    if n%3==0:
        if (a^b)==c:
            canPuton=True
            for key in aDict.keys():
                if aDict[key]!=n//3:
                    canPuton=False
if canPuton:
    print('Yes')
else:
    print('No')
a=int(input())
x,y = map(int,input().split())	

b = x//a
c = y//a

if c-b <= 1:
    print('NG')
elif:
    print('OK')

### FIXED CODE ###

k=int(input())
a,b = map(int,input().split())	

c = b // k
d = k*c

if a <= d and d <= b:
    print('OK')
else:
    print('NG')
usrInput = input()

if usrInput == "SUN":
    DayPlace = 0
elif usrInput == "MON":
    DayPlace = 1
elif usrInput == "TUE":
    DayPlcae = 2
elif usrInput == "WED":
    DayPlace = 3
elif usrInput == "THU":
    DayPlace = 4
elif usrInput == "FRI":
    DayPlace = 5
elif usrInput == "SAT":
    DayPlace = 6

finalOutput = 7 - DayPlace
print(finalOutput)

### FIXED CODE ###

usrInput = input()

if usrInput == "SUN":
    DayPlace = 0
elif usrInput == "MON":
    DayPlace = 1
elif usrInput == "TUE":
    DayPlace = 2
elif usrInput == "WED":
    DayPlace = 3
elif usrInput == "THU":
    DayPlace = 4
elif usrInput == "FRI":
    DayPlace = 5
elif usrInput == "SAT":
    DayPlace = 6

finalOutput = 7 - DayPlace
print(finalOutput)
g="013121212121"
x,y=map(int,input().split())
print("Yes"if g[x]==g[y] else "No")

### FIXED CODE ###

g="0131212112121"
x,y=map(int,input().split())
print("Yes"if g[x]==g[y] else "No")
a,b,x = map(int,input().split())

import math
if (x/a < 0.5*a*b):
  print(90-math.degrees(math.atan((2*x)/(a*b**2))))
else:
  print(90-math.degrees(math.atan(0.5*a**3/((b*a**2)-x))))

### FIXED CODE ###

a,b,x = map(int,input().split())

import math
if (x/a < 0.5*a*b):
  print(90-math.degrees(math.atan((2*x)/(a*b**2))))
elif (x/a == a*b):
  print(0)
else:
  print(90-math.degrees(math.atan(0.5*a**3/((b*a**2)-x))))
n = int(input())
l = []
while n:
    N -= 1
    l.append(chr(97+(n % 26)))
    n //= 26

print("".join(l[::-1]))


### FIXED CODE ###

N = int(input())
l = []
while N:
    N -= 1
    l.append(chr(97+(N % 26)))
    N //= 26

print("".join(l[::-1]))
import itertools
N,M = map(int,input().split())
A = []
X = [[0]]*M

for m in range(M):
  a,b = map(int,input().split())
  A.append([a,b])
  X[m] = X[m] + [a] + [b]

ans = []
for m,v in itertools.product(range(M),A):
    if X[m][-1] == v[0]:
      if v[1] in X[m]:
        ans.append(X[m])
      else:
        X[m] = X[m] + [v[1]]

if ans == []:
  print(-1)
else:
  n = m+2
  for a in ans:
    if n > len(a):
      ans_min = a
  ans_min[0] = len(ans_min)-1
  print(ans_min)


### FIXED CODE ###

def main():
  from collections import deque
  n,m,*t=map(int,open(0).read().split())
  i=[0]*n
  o=[[]for _ in range(n)]
  for a,b in zip(*[iter(t)]*2):
    o[a-1]+=b-1,
    i[b-1]+=1
  q=deque(v for v,f in enumerate(i)if f<1)
  r=[]
  while q:
    v=q.popleft()
    r+=v,
    for w in o[v]:
      i[w]-=1
      if i[w]==0:q+=w,
  print(-(len(r)==n))
main()
N=input()
a=[int(i) for i in N
b=sum(a)

if b%9==0:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

N=input()
a=[int(i) for i in N]
b=sum(a)

if b%9==0:
	print("Yes")
else:
	print("No")
x = int(input())

a = 100
i = 0

while a < x:
  i+ = 1
  a *= 1.01
  
  
print(math.floor(i))
  



### FIXED CODE ###

x = int(input())

a = 100
i = 0

while a < x:
  i += 1
  a += a // 100
  
  
print(i)
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)

if a[0]==1:
    if a[1]==1:
        print(0)
    else:
        print(1)
else:
    ans = 0
    for num in a:
        if a.count(num) >= 2:
            continue
        else:
            cands = set([i for i in a if i!=num])
            divs = set(make_divisors(num))
            if not cands&divs:
                ans+=1
            
    print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
M = max(a)
cands = [0]*M

ans = 0
for num in a:
    if cands[num-1] >= 2:
        continue
    for i in range(num, M+1, num):
        cands[i-1] += 1
        
for num in a:
    if cands[num-1]==1:
        ans+=1
print(ans)
from math import floor
a,b = map(float,input().split())
ans = math.floor(a * b)
print(ans)

### FIXED CODE ###

a,b=input().split()
a = int(a)
b = float(b)
b = round(b * 100)
ans = (a*b) // 100
print(ans)
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

if N ==0:
  print('Yes')
elif digitSum(N)%9 ==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = int(input())
if N ==0:
  print('Yes')
elif sum(list(map(int, str(N))))%9 ==0:
  print('Yes')
else:
  print('No')
n,m,k = map(int,input().split())

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

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

x = [0]

y = [0]

for i in range(n):
    x.append(x[i]+a[i])

for i in range(m):
    y.append(y[i]+b[i])

ans = 0

cnt = m

for i in range(n+1):
    
    if x[i]<0:
        break
    
    while y[cnt]>k-x[i]:
        cnt -= 1
        
    ans = max(ans,cnt+i)
    
print(ans)

### FIXED CODE ###

n,m,k = map(int,input().split())

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

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

x = [0]

y = [0]

for i in range(n):
    x.append(x[i]+a[i])

for i in range(m):
    y.append(y[i]+b[i])

ans = 0

cnt = m

for i in range(n+1):
    
    if k-x[i]<0:
        break
    
    while y[cnt]>k-x[i]:
        cnt -= 1
        
    ans = max(ans,cnt+i)
    
print(ans)
#ABC071C
N=int(input())
A=list(map(int,input().split()))
max_A=max(A)
lines=[0]*(max_A+1)
long_line=0
for i in range(N):
    lines[A[i]]+=1
if max(lines)<2:
    print(0)
    exit()
for i in range(max_A):
    j=max_A-i
    if lines[j]>=4:
        if long_line>0:
            print(long_line*j)
            exit()
        else:
            print(j*j)
            exit()
    elif lines[j]>=2:
        if long_line>0:
            print(long_line*j)
            exit()
        else:
            long_line=j
print(0)

### FIXED CODE ###

#ABC071C
N=int(input())
A=list(map(int,input().split()))
A_sorted=sorted(A,reverse=True)
long_line=0
lines=1
for i in range(N-1):
    if A_sorted[i]==A_sorted[i+1]:
        lines+=1
    if A_sorted[i]!=A_sorted[i+1] or i==N-2:
        if lines>=4:
            if long_line>0:
                print(long_line*A_sorted[i])
                exit()
            else:
                print(pow(A_sorted[i], 2))
                exit()
        elif lines>=2:
            if long_line>0:
                print(long_line * A_sorted[i])
                exit()
            else:
                long_line=A_sorted[i]
        lines=1
print(0)
def solve(a,dp,n):
  if n==0 or n==1:
    return 0
  if n==2:
    return abs(a[0]-a[1])
  if dp[n]>0:
    return dp[n]
  opt1 = abs(a[n-1]-a[n-1-1])+solve(a,dp,n-1)
  opt2 = abs(a[n-1]-a[n-2-1])+solve(a,dp,n-2)
  output = min(opt1,opt2)
  dp[n]=output
  return output

n = int(input())
a = list(map(int,input().split()))
dp = [0]*(n+1)
print(solve(a,dp,n))


 

### FIXED CODE ###

import sys

n = int(input())
a = list(map(int,input().split()))
dp = [sys.maxsize]*(n)
dp[0] = 0
for i in range(n-1):
  for j in (i+1,i+2):
    if j<n:
      dp[j] = min(dp[j],dp[i]+abs(a[i]-a[j]))

print(dp[n-1])
a = sorted(input().split() ,reverse=True)
print(int(a[0]+a[1

### FIXED CODE ###

a = sorted(input().split() ,reverse=True)
print(int(a[0]+a[1]) + int(a[2]))
import math
n, X = list(map(int, input().split()))
x = list(map(int, input().split()))

x = sorted(x+[X])
# print(x)
x_diff = [x[i+1]-x[i] for i in range(n)]
ans = x_diff[0]
for i in range(1, len(x_diff)):
    ans = math.gcd(ans, x_diff[i])
print(ans)


### FIXED CODE ###

import fractions
n, X = list(map(int, input().split()))
x = list(map(int, input().split()))

x = sorted(x+[X])
x_diff = [x[i+1]-x[i] for i in range(n)]
# print(x, x_diff)
ans = x_diff[0]
for i in range(1, n):
    ans = fractions.gcd(ans, x_diff[i])
print(ans)
n=int(input())
p=list(map(int,input().split()))
q=[]
for i in range(n-1):
  q.append(p[i+1]-p[i])
cnt=q.count(1)
if cnt=>3:
  print('NO')
else:
  print('YES')
  

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
cnt=0
for i in range(n):
  if p[i]!=i+1:
    cnt+=1
if cnt>2:
  print('NO')
else:
  print('YES')
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
count1=0
a=len(L)
#print(L)
for i in range(a-2):
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
         break

print(count)


### FIXED CODE ###

a,b=map(int,input().split())
if a>=2*b:
  print(a-2*b)
else:
  print(0)