Harryxun/stf_run huggingface dataset:
N=int(input())
A,B  = list(map(int, input().split()))
lis = list(map(int, input().split()))
lis_1=[]
lis_2=[]
lis_3=[]
for i in lis:
    if i <= A:
       lis_1.append(i)
    elif i > A and i <=B:
       lis_2.append(i)
    else:
       lis_3.append(i)

print(min[len(lis_1),len(lis_2),len(lis_3)])

### FIXED CODE ###

N=int(input())
A,B  = list(map(int, input().split()))
lis = list(map(int, input().split()))
lis_1=[]
lis_2=[]
lis_3=[]
for i in lis:
    if i <= A:
       lis_1.append(i)
    elif i > A and i <=B:
       lis_2.append(i)
    else:
       lis_3.append(i)

print(min([len(lis_1),len(lis_2),len(lis_3)]))
x,y=map(int,input().split())
mod = 10**9+7
flflag=True

if (2*x-y)%3==0:
  a=(2*x-y)//3
else:
  flflag=False
if (2*y-x)%3==0:
  b=(2*y-x)//3
else:
  flflag=False

def kaijou(n):
  ans = 1
  for i in range(1,n+1):
    ans*=i%mod
    ans%=mod  
  return ans

N=a+b
R=min(a,b)
ans=0
if a>=0 and b>=0 and flflag==True:
  ans=kaijou(N)
  ans1= (kaijou(N-R)*kaijou(R))%mod
  print((ans*pow(ans1,mod-2,mod))%mod)
else:
  print(0)

### FIXED CODE ###

x,y=map(int,input().split())
mod = 10**9+7
flflag=True

if (2*x-y)%3==0:
  a=(2*x-y)//3
else:
  flflag=False
if (2*y-x)%3==0:
  b=(2*y-x)//3
else:
  flflag=False

def kaijou(n):
  ans = 1
  for i in range(1,n+1):
    ans*=i%mod
    ans%=mod  
  return ans
if flflag:
  N=a+b
  R=min(a,b)
ans=0
if flflag==True and a>=0 and b>=0:
  ans=kaijou(N)
  ans1= (kaijou(N-R)*kaijou(R))%mod
  print((ans*pow(ans1,mod-2,mod))%mod)
else:
  print(0)
import sys
sys.setrecursionlimit(10**6)
from collections import deque
from itertools import chain

def bfs(maze,visited,gy,gx):
    que = deque([[0,0]])
    visited[0][0] = 0
    
    while que:
        y,x = que.popleft()
        if [y,x] == [gy,gx]:
            return visited[y][x]
        for j,k in ([1,0],[-1,0],[0,1],[0,-1]):
            ny,nx = y+j,x+k
            if 0 <= ny < w and 0 <= nx < h:
                if maze[ny][nx] == "." and visited[ny][nx] == -1:
                    visited[ny][nx] = visited[y][x] + 1
                    que.append([ny,nx])

h,w = map(int,input().split())
maze = [input() for _ in range(h)]
visited = [[-1]*(w) for _ in range(h)]
sr = bfs(maze,visited,h-1,w-1)

num_dot = list(chain.from_iterable(maze))
num_dot = num_dot.count('.')
print(num_dot - sr - 1)

### FIXED CODE ###

from collections import deque

def bfs(maze,visited,sy,sx,gy,gx):
    Step = ([1,0],[0,1],[-1,0],[0,-1])
    
    que = deque([[sx,sy]])
    visited[sx][sy] = 1
    
    while que:
        y,x = que.popleft()
        if [y,x] == [gy,gx]:
            return visited[y][x]
        for j,k in Step:
            ny,nx = y+j , x+k
            if 0 <= ny <= gy and 0 <= nx <= gx:
                if maze[ny][nx] == '.' and visited[ny][nx] == INF:
                    visited[ny][nx] = visited[y][x] + 1
                    que.append([ny,nx])


h,w = map(int,input().split())
maze = [input().strip() for _ in range(h)]

cntSharp = 0
for i in range(h):
    cntSharp += maze[i].count('.')

INF = 10**5
visited = [[INF]*w for _ in range(h)]

sx,sy = 0,0
gy,gx = h-1,w-1

minStep = bfs(maze,visited,sy,sx,gy,gx)
print(cntSharp - minStep if visited[gy][gx] != INF else -1)
import sys
import math

sys.setrecursionlimit(100000000)

n = int(input())
s = int(input())

def f(b, n):
    if n<b:
        return n
    else:
        return f(b, n//b) + n%b

if s > n:
    print(-1)
if s==n:
    print(s+1)
else:
    for b in range(2, math.ceil(math.sqrt(n))+1):
        if f(b, n)==s:
            print(b)
            break
    else:
        if f(n+1-s, n)==s:
            print(n+1-s)
        else:
            print(-1)

### FIXED CODE ###

import sys
import math

sys.setrecursionlimit(100000000)

n = int(input())
s = int(input())

def f(b, n):
    if n<b:
        return n
    else:
        return f(b, n//b) + n%b

if s > n:
    print(-1)
elif s==n:
    print(s+1)
else:
    for b in range(2, math.ceil(math.sqrt(n))+1):
        if f(b, n)==s:
            print(b)
            break
    else:
        for d in range(math.floor(math.sqrt(n)), 0, -1):
            if (n-s)%d==0 and f((n-s)//d+1, n)==s:
                print((n-s)//d+1)
                break
        else:
            print(-1)
import statistics
data=[]
while True:
    data.append(input().split())
    if ["0"] in data:
        break
data=data[:-1]
data_i=[]
def a():
    
for i in data:
    data_i.append(list(map(lambda i:int(i),i)))
for i in data_i:
    if len(i)==1:
        pass
    else:
        print(statistics.pstdev(i))



### FIXED CODE ###

from statistics import pstdev
while input()!="0":
    lst=map(int,input().split())
    print(pstdev(lst))
from collections import Counter
import bisect
N = int(input())
A = list(map(int,input().split()))

cnt = Counter(A)
A.sort()
ans = 0
for j in range(len(A)):

    a = A[j]
    if cnt[a] > 1:
        continue
    if j==0:
        ans+=1

    i = bisect.bisect_right(A, pow(a,0.5))
    #print(a,i)


    ok = True

    while(i>=0):
        if a % A[i]==0:
            #print (a,A[i])
            ok = False
            break
        i-=1
    if ok:
        #print(a)
        ans+=1
print (ans)



### FIXED CODE ###

from collections import Counter
import bisect
N = int(input())
A = list(map(int,input().split()))



cnt = Counter(A)
A.sort()
ans = 0
P = [0] * (10**6+1)
#print(cnt)
for a in A:
    if P[a]==0:
        for i in range(10**7):
            x = a*i
            if x>10**6:
                break
            P[x] = 1
        if cnt[a]==1:
            ans +=1

print (ans)
n=int(input())
temp,a=map(int,input().split())
hs=map(int,input().split())

t=list(map(lambda h: temp-h*0.006, hs))
t=list(enumerate(t,1))

def solve(best,a,t):
    if not t:
        return best[0]
    if abs(best[1] - a) < abs(t[0][1] - a):
        return solve(best, a, t[1:])
    else:
        return solve(t[0],a,t[1:])

print(solve(t[0],a,t[1:]))


### FIXED CODE ###


n=int(input())
temp,a=map(int,input().split())
hs=map(int,input().split())

t=list(map(lambda h: temp-h*0.006, hs))
t=list(enumerate(t,1))

def solve(best,a,t):
    if not t:
        return best[0]
    if abs(best[1] - a) < abs(t[0][1] - a):
        return solve(best, a, t[1:])
    else:
        return solve(t[0],a,t[1:])

min_diff = 100000000
res = 0
for i in range(len(t)):
    if min_diff > abs(t[i][1] - a):
        min_diff = abs(t[i][1] - a)
        res = i + 1


print(res)
import math
import functools
n = int(input())
t = [int(input()) for _ in range(n)]

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
ans = functools.reduce(lcm, t)
print(ans)

### FIXED CODE ###

import functools
import fractions
n = int(input())
t = [int(input()) for _ in range(n)]

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
    
ans = functools.reduce(lcm, t)
print(ans)
A, B = map(int, input().split())
S = list(input())

if S[B] == '-':
    for i in range(8):
        if i == B:
            continue
        else:
            if S[i] == '-':
                print('No')
                break
    print('Yes')
else:
    print('No')


### FIXED CODE ###

A, B = map(int, input().split())
S = input()

fwd = S[0:A]
bwd = S[A+1:]
flag = 0
if fwd.isdigit() == True:
    if S[A] == '-':
        if bwd.isdigit() == True:
            flag = 1
if flag == 1:
    print('Yes')
else:
    print('No')
import sys

data = sys.stdin().read()
for i in range(0x61,0x7b):
    print("%c : %d"  %(i,data.lower().count(chr(i))))


### FIXED CODE ###

import sys

data = sys.stdin.read()
for i in range(0x61,0x7b):
    print("%c : %d"  %(i,data.lower().count(chr(i))))
def min_sufficient_load(w, k):
    return check(w, k, 0, sum(w))


def check(w, k, p1, p2):
    trunk_no = 1
    temp = 0
    m = 1+(p1 + p2)>>1
    for i in w:
        if temp + i <= m:
            temp += i
            if temp==m:
                trunk_no+=1
                temp = 0
        else:
            trunk_no += 1
            temp = i
    if trunk_no > k:
        return check(w, k, m, p2)
    else:
        if m - p1 == 1:
            return m
        return check(w, k, p1, m)
if __name__=="__main__":
    n,k = map(int,input().split(" "))
    w = []
    for i in range(n):
        w.append(int(input()))
    print(min_sufficient_load(w,k))


### FIXED CODE ###

import math
def min_sufficient_load(w, k):
    return check(w, k, 0, sum(w))

def check(w, k, p1, p2):
    if k==1:
        return p2
    if p2 - p1 == 1:
        if get_trunk_No(w, p1) == k:
            return max(p1,max(w))
        else:
            return max(p2,max(w))
    m = math.ceil((p1+p2)/2)
    trunk_no = get_trunk_No(w,m)
    if trunk_no > k:
        return check(w, k, m, p2)
    else:
        return check(w, k, p1, m)
def get_trunk_No(w,m):
    temp = 0
    trunk_no = 1
    for i in w:
        if temp + i <= m:
            temp += i
            if temp == m:
                trunk_no += 1
                temp = 0
        else:
            trunk_no += 1
            temp = i
    if temp==0:
        trunk_no-=1
    return trunk_no
if __name__=="__main__":
    n,k = map(int,input().split(" "))
    w = []
    for i in range(n):
        w.append(int(input()))
    print(min_sufficient_load(w,k))
import sys
from bisect import bisect_left, bisect_right
from copy import deepcopy
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = list(map(int, input().split()))
    repn = [[] for _ in range(N)]
    for _ in range(N - 1):
        u, v = map(int, input().split())
        repn[u - 1].append(v - 1)
        repn[v - 1].append(u - 1)
    
    Length = [0] * N
    Length[0] = 1
    q = [(0, [A[0]])] # (vertex, dp)

    while q:
        v, dp = q.pop()
        for u in repn[v]:
            if Length[u] != 0:
                continue
            if A[u] > dp[-1]:
                Length[u] = Length[v] + 1
                new_dp = dp + [A[u]]
            else:
                Length[u] = Length[v]
                idx = bisect_right(dp, A[u])
                new_dp = deepcopy(dp)
                new_dp[idx] = A[u]
            q.append((u, new_dp))
    
    for ans in Length:
        print(ans)



    


    


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
from bisect import bisect_left, bisect_right
sys.setrecursionlimit(2*10**5)
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = list(map(int, input().split()))
    repn = [[] for _ in range(N)]
    for _ in range(N - 1):
        u, v = map(int, input().split())
        repn[u - 1].append(v - 1)
        repn[v - 1].append(u - 1)
    
    length = [0] * (N + 1)
    dp = [-1]

    """
    やはり各頂点でLIS配列を取ると配列コピーの時間がかかってTLEするので、
    配列は唯一つを扱って、DFSからバックするときに配列も元に戻す操作を行いたい
    （ここの実装の仕方がわからなかった）

    これはdfsを再帰で書いた後に復元操作を追記すれば異常に楽に書ける。。。
    """

    def dfs(v, p=N):
        if A[v] > dp[-1]:
            dp.append(A[v])
            length[v] = length[p] + 1
            for u in repn[v]:
                if u == p: continue
                dfs(u, v)
            dp.pop()
        else:
            length[v] = length[p]
            idx = bisect_left(dp, A[v]) # bisect_rightだとdpに重複する値を書き込んでしまうのでダメ
            old = dp[idx]
            dp[idx] = A[v]
            for u in repn[v]:
                if u == p: continue
                dfs(u, v)
            dp[idx] = old
        #print("v={}, len={}, dp={}".format(v, length[v], dp))

    dfs(0)
    length.pop()
    for ans in length:
        print(ans)
    


if __name__ == "__main__":
    main()
MOD = 10**9+7

n = int(input())
s = input()

if s[0] == "W" or s[-1] == "W":
    print(0):
    exit()

kai = [1 for _ in range(n+1)]
for i in range(1, n+1):
    kai[i] = kai[i-1] * i
    kai[i] %= MOD

def mul(a, b):
    return (a * b) % MOD

a = "L"
l = ["L", "R"]
c = 0

for i in range(1, len(s)):
    if s[i] == s[i-1]:
        c = not c
    a = a + l[c]


ans = 1
num = 0
for i in range(len(s)):
    if a[i] == "L":
        num += 1
    else:
        ans *= num
        ans %= MOD
        num -= 1

ans *= kai[n]
ans %= MOD

print(ans)


### FIXED CODE ###

N = int(input())
S = input()
ss = [1 if s == 'W' else 0 for s in S]

def mul(a, b):
    return (a * b) % (10**9 + 7)

ans = 1
num = 0
for s in ss:
    if num % 2 == s:
        num += 1
    else:
        ans = mul(ans, num)
        num -= 1

if num > 0:
    ans = 0

for i in range(2, N + 1):
    ans = mul(ans, i)

print(ans)
from collections import defaultdict
import heapq
v_num = int(input())
connect = defaultdict(list)

for _ in range(v_num):
    que = [int(n) for n in input().split(" ")]
    connect[que[0]] = [[v, w] for v, w in zip(que[2:len(que):2], que[3:len(que):2])
    # weight_edge[que[0]] = {k:v for k, v in zip(que[2:len(que):2], que[3:len(que):2])}
queue = []
heapq.heapify(queue)
heapq.heappush(queue, [0, 0])
distance = [-1 for n in range(v_num)]
went = 0
visited = set()
while went < v_num:
    q = heapq.heappop(queue)
    weight, here = q
    if here in visited:
        continue
    visited |= {here}
    went += 1
    distance[here] = weight
    for conn in connect[here]:
        if conn[0] not in visited:
            heapq.heappush(queue, [weight + conn[1], conn[0]])
for i in range(v_num):
    print(i, distance[i])

### FIXED CODE ###

from collections import defaultdict
import heapq
v_num = int(input())
connect = defaultdict(list)

for _ in range(v_num):
    que = [int(n) for n in input().split(" ")]
    connect[que[0]] = [[v, w] for v, w in zip(que[2:len(que):2], que[3:len(que):2])]
    # weight_edge[que[0]] = {k:v for k, v in zip(que[2:len(que):2], que[3:len(que):2])}
queue = []
heapq.heapify(queue)
heapq.heappush(queue, [0, 0])
distance = [-1 for n in range(v_num)]
went = 0
visited = set()
while went < v_num:
    q = heapq.heappop(queue)
    weight, here = q
    if here in visited:
        continue
    visited |= {here}
    went += 1
    distance[here] = weight
    for conn in connect[here]:
        if conn[0] not in visited:
            heapq.heappush(queue, [weight + conn[1], conn[0]])
for i in range(v_num):
    print(i, distance[i])
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
k = (a + b) / 2
l = (a + b) % 2
if l == 0:
    print(k)
else:
    print(“IMPOSSIBLE”)


### FIXED CODE ###

# -*- coding: utf-8 -*-

a_b_list = list(map(int,input().split()))
a = a_b_list[0]
b = a_b_list[1]

k = (a + b) / 2
l = (a + b) % 2

if l == 0:
  print(int(k))
else:
  print("IMPOSSIBLE")
n,m,k = list(map(int,input().split()))

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

if k < a[0] and k < b[0]:
    print(0)

count = [[0 for i in range(n + 1)] for j in range(m + 1)]

answer = 0
for i in range(n+2):
    for j in range(m):
        if j != 0:
            count[i][j] = count[i][j-1] + a[j-1]
        if count[i][j] > k:
            break
        if answer < i + j and count[i][j] <= k:
            answer = i + j
    if i == n + 1:
        break
    count[i+1][0] = count[i][0] + b[i]
    if count[i+1][j] > k:
        break 

print(answer)


### FIXED CODE ###

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

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

asum = [0]
bsum = [0]

for i in range(n):
    asum.append(asum[i] + a[i])
for i in range(m):
    bsum.append(bsum[i] + b[i])

best = m
answer = 0
for i in range(n+1):
    j = best
    while 1:
        if bsum[j] <= (k - asum[i]):
            best = j
            if answer < i + j:
                answer = i + j
            break
        j -= 1
        if j < 0:
            break

print(answer)
a,b=map(int,input().split())

ptint("{0} {1} {2:.8f}".format(a//b,a%b,a/b))


### FIXED CODE ###

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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))
a,b,c=sorted(map(int,input.split()))
print(c*10 + b + a)

### FIXED CODE ###

a,b,c=sorted(map(int,input().split()))
print(c*10 + b + a)
S = list(input())
S.append('end')
K = int(input())
length = []
tl = 1
x = 0
ans = 0
J = True
same = 1
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    same += 1
if same == len(S):
  J = False
if S[0] != S[len(S)-1] and J
  for i in range(len(S)-1):
    if S[i] == S[i+1]:
      tl += 1
    else:
      length.append(tl)
      tl = 1
  for i in range(len(length)):
    x += length[i]//2
  ans += x*K
  print(ans)
elif not J:
  ans = len(S)*K//2
  print(ans)
else:
  for i in range(len(S)-1):
    if S[i] == S[i+1]:
      tl += 1
    else:
      length.append(tl)
      tl = 1
  ans += ((length[0]+length[len(length)])*(K-1)//2) + length[0]//2 + length[length]//2
  length[0] = 0
  length[len(length)] = 0
  for i in range(len(length)):
    x += length[i]//2
  ans += x*K
  print(ans)
  


### FIXED CODE ###

S = list(input())
R = int(input())
lengths = []
same = False
All = False
odd = False
sl = 1
Sum = 0
if S[0] == S[len(S)-1]:
  same = True
S.append('0')
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    sl += 1
  else:
    lengths.append(sl)
    sl = 1
if len(lengths) == 1:
  All = True
if lengths[0]%2 == 1 and lengths[len(lengths)-1]%2 == 1:
  odd = True
if same:
  if All:
    Sum += (lengths[0]*R)//2
  else:
    temp = lengths[0]
    lengths[0] = 0
    lengths[len(lengths)-1] += temp
    if odd:
      for l in range(len(lengths)):
        Sum += (lengths[l]//2)*R
      Sum -= 1
    else:
      for g in range(len(lengths)):
        Sum += (lengths[g]//2)*R
else:
  for j in range(len(lengths)):
    Sum += (lengths[j]//2)*R
print(Sum)
s=list(input())
p=[chr(ord("a")+i)for i in range(26)]
q=100
if len(list(set(d)))==1:
    print(0)
else:
    for i in range(26):
        t=p[i]
        d=s[:]
        c=0
        while len(d)>0:
            c+=1
            for j in range(len(d)-1):
                if d[j]==t or d[j+1]==t:
                    d[j]=t
            else:
                d.pop(-1)
                if len(list(set(d)))==1 and d[0]==t:
                    break
        q=min(q,c)
    print(q)

### FIXED CODE ###

s=list(input())
p=[chr(ord("a")+i)for i in range(26)]
q=100
if len(list(set(s)))==1:
    print(0)
else:
    for i in range(26):
        t=p[i]
        d=s[:]
        c=0
        while len(d)>0:
            c+=1
            for j in range(len(d)-1):
                if d[j]==t or d[j+1]==t:
                    d[j]=t
            else:
                d.pop(-1)
                if len(list(set(d)))==1 and d[0]==t:
                    break
        q=min(q,c)
    print(q)
def calc(s, t):
    t_l = [x[0] for x in t]
    s_r = [x[1] for x in s]
    return max(min(s_r) - max_L, 0) + max(min_R - max(t_l), 0)


N = int(input())
sections = []

L, R = map(int, input().split())
sections.append((L, R + 1))
p = 0
max_L = L
q = 0
min_R = R

for i in range(1, N):
    L, R = map(int, input().split())
    R += 1
    sections.append((L, R))
    if L > max_L:
        p = i
        max_L = L
    if R < min_R:
        q = i
        min_R = R

s = [sections[p]]
t = [sections[q]]
sections.pop(p)
sections.sort(key=lambda x: (x[1], x[0]))
sections.pop(0)  # q
s = sections + s

ranges = [x[1] - x[0] for x in sections]
ans1 = max(ranges) + max(min_R - max_L, 0)

ans2 = calc(s, t)

for i in range(len(sections)):
    t += [s.pop(0)]
    ans2 = max(ans2, calc(s, t))

print(max(ans1, ans2))


### FIXED CODE ###

N = int(input())
LR = []
p = 0
max_L = 0
q = 0
min_R = 10**9 + 1

for i in range(N):
    L, R = map(int, input().split())
    R += 1
    LR.append((L, R))
    if L > max_L:
        p = i
        max_L = L
    if R < min_R:
        q = i
        min_R = R

ans1 = max(R - L for L, R in LR) + max(min_R - max_L, 0)

if N == 2:
    print(sum(R - L for L, R in LR))
    exit()

if p == q:
    print(ans1)
    exit()

L1, R1 = LR[p]
L2, R2 = LR[q]
LR = [(L, R) for i, (L, R) in enumerate(LR) if i != p and i != q]
LR.sort(key=lambda x: (x[1], x[0]), reverse=True)

n = len(LR) + 1
min_sr = [R1] * n
max_tl = [L2] * n

for i in range(1, n):
    min_sr[i] = min(min_sr[i-1], LR[i-1][1])
    max_tl[n-i-1] = max(max_tl[n-i], LR[n-i-1][0])

ans2 = max(max(r - L1, 0) + max(R2 - l, 0) for r, l in zip(min_sr, max_tl))

print(max(ans1, ans2))
import numpy as np

n=100
X = int(input())

a = np.array(range(n))
ex = np.full(n, 5)

m = a*n+a.reshape(n,1)

b = np.power(a, ex)

plus = b + b.reshape(n,1)
minus = b - b.reshape(n,1)

plus = plus==X
minus = minus==X

if np.count_nonzero(plus):
  c = m[plus][0]
  ans = int(c/n), -int(c%n)
else:
  c = m[minus][0]
  ans = int(c/n), int(c%n)
  
print(ans[0], ans[1], sep=' ')

### FIXED CODE ###

import numpy as np

n=1000
X = int(input())

a = np.array(range(n))
ex = np.full(n, 5)

m = a*n+a.reshape(n,1)

b = np.power(a, ex)

plus = b + b.reshape(n,1)
minus = b - b.reshape(n,1)

plus = plus==X
minus = minus==X

if np.count_nonzero(plus):
  c = m[plus][0]
  ans = int(c/n), -int(c%n)
else:
  c = m[minus][0]
  ans = int(c/n), int(c%n)
  
print(ans[0], ans[1], sep=' ')
import numpy as np
N = int(input())
h = np.ndarray(input().split(), dtype='int32')
dp = np.zeros(N, dtype='int32')

dp[1] = np.abs(h[1]-h[0])
if N > 2:
    for i in range(2, N):
        dp[i] = np.min(dp[i-2:i] + np.abs(h[i]-h[i-2:i]))

print(dp[-1])

### FIXED CODE ###

N = int(input())
h = [int(i) for i in input().split()]

dp = [0] * N
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, N):
    dp_1 = dp[i-2] + abs(h[i]-h[i-2])
    dp_2 = dp[i-1] + abs(h[i]-h[i-1])
    dp[i] = min(dp_1, dp_2)
    
print(dp[N-1])
a = input()
a.sprit()
if a[0] == a[1]:
     if a[1] == a[2]:
         print('Yes')
     else:
         print('No')
else:
     print('No')

### FIXED CODE ###

a = input()
b = a.split()
if b[0] == b[1]:
    if b[1] == b[2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
import numpy as np
N, M ,C = map(int, input().split())
a = []
for i in range(M):
    a.append(list(map(int, input().split())))
all = np.array(a)
sum = 0
num = 0

for i in range(N):
    mul = np.sum(all[0] * all[i+1]) + C
    if mul > 0:
        num += 1
    mul = 0

print(num)

### FIXED CODE ###

import numpy as np
N, M ,C = map(int, input().split())
a = []
for i in range(N+1):
    a.append(list(map(int, input().split())))
all = np.array(a)
sum = 0
num = 0

for i in range(N):
    mul = np.sum(all[0] * all[i+1]) + C
    if mul > 0:
        num += 1
    mul = 0

print(num)
# coding: utf-8

s = input()
k = int(input())

not_one_index = 0
i = 0
while True:
    if s[i] == '1':
        not_one_index = not_one_index + 1
        i = i + 1
    else:
        break

if k < not_one_index:
    print(1)
else:
    print(s[not_one_index])


### FIXED CODE ###

# coding: utf-8

s = input()
k = int(input())

not_one_index = 0
for i in range(len(s)):
    if s[i] == '1':
        not_one_index = not_one_index + 1
    else:
        break

if k <= not_one_index:
    print(1)
else:
    print(s[not_one_index])
n=int(input())
for _ in range(n):
  a.append(int(input()))
l=[l[0]]*n
for i in range(1,n):
  l[i] = max(a[i],l[i-1])
a.reverse()
r=[r[0]]*n
for i in range(1,n):
  r[i] = max(a[i],r[i-1])
for i in range(n):
  print(max(l[i-1],r[n-i-1]))

 

### FIXED CODE ###

N=int(input())
A=[]
for _ in range(N):
  A.append(int(input()))

value=max(A)
index = A.index(max(A))
for i in range(N):
  if i==index:
    b=A.pop(i)
    print(max(A))
  else:
      print(value)
A, B = map(int, input().split())

value = A - B * 2
if value >= 0:
  return value
else:
  return 0

### FIXED CODE ###

A, B = map(int, input().split())
 
value = A - B * 2
if value >= 0:
  print(value)
else:
  print(0)