Harryxun/stf_run huggingface dataset:
from heapq import heapify,heappush,heappop
import math

n,K = map(int,input().split())
v = list(map(int,input().split()))

ans = 0
sum_d = 0
d = []
heapify(d)
# i = 操作回数
# j = 取る回数 (i-j = 捨てる回数)
# k = 左から取る回数 (j-k = 右から取る回数)
for i in range(1,K+1):
	for j in range(math.ceil(i/2),i+1):
		for k in range(j+1):
			#print(i,j,k,j-k,i-j,ans)
			# 左から取る
			for l in range(k):
				heappush(d,v[l])
				sum_d += v[l]
			# 右から取る
			for l in range(j-k):
				heappush(d,v[-l-1])
				sum_d += v[-l-1]
			for l in range(i-j):
				sum_d -= heappop(d)
			ans = max(sum_d,ans)
			sum_d = 0
			d = []
			heapify(d)
print(ans)


### FIXED CODE ###

from collections import deque
import heapq

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


#a : heapq.heappop(s,v.popleft())
#b : heapq.heappop(s,v.pop())
#c : v.appendleft(heapq.heappop(s))
#d : v.append(heapq.heappop(s))
ans = 0
for i in range(1,min(n,k)+1):
    for j in range(i+1):
        s = []
        heapq.heapify(s)
        res = 0
        num = 0
        for _ in range(j):
            heapq.heappush(s,v[num])
            res += v[num]
            num += 1
        num = 1
        for _ in range(j,i):
            heapq.heappush(s,v[-num])
            res += v[-num]
            num += 1

        for j in range(k-i):
            if len(s) == 0:
                break
            if s[0] < 0:
                res -= heapq.heappop(s)
            else:
                break
        if ans < res:
            ans = res
    #print(i,ans)
print(ans)
s = input()
print(s.replace(","," ")

### FIXED CODE ###

s = input().replace(","," ")
print(s)
x = input()
for i in range(int(input())):
	a = input().split()


	if a[0] == 'print':
		for i in range(1,len(a)):
			a[i]=int(a[i])
		print(x[a[1]:a[2]+1])
	elif a[0] == 'replace':
		for i in range(1,len(a)-1):
			a[i]=int(a[i])
		x = x[:a[1]] +a[3]+ x[a[2]:]
	elif a[0] == 'reverse':
		for i in range(1,len(a)):
			a[i]=int(a[i])
		x[a[1]:a[2]] = x[a[2]:a[1]:-1]



### FIXED CODE ###

x = input()
for i in range(int(input())):
	o = input().split()
	a,b = map(int,o[1:3])
	b+=1
	t = o[0][2]
	if t == 'i':
		print(x[a:b])
	elif t =='p':
		x = x[:a] + o[3] + x[b:]
	else:
		x = x[:a] + x[a:b][::-1] + x[b:]
N=int(input())
s=0
for i in range(N):
  a=int(input())
  s+=1/a
print(1/s)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = [1/i for i in A]
print(1/sum(B))
s = input()
a = int(len(s))
print("x" * s)

### FIXED CODE ###

s = input()
a = len(s)
print("x" * a)
def calendar():
    m, d = map(int, input().split())
    
    res = []
    for month in range(1, m + 1):
        for day in range(2, d + 1):
            for x in range(2, d + 1):
                if x * day == month:
                    temp = str(day) + str(x)
                    temp = int(temp)
                    if temp <= d:
                        res.append(temp)
    return res


calendar(15, 40)

### FIXED CODE ###

def calendar():
    m, d = map(int, input().split())
    res = []
 
    for month in range(1, m + 1):
        for day in range(2, 10):
            for x in range(2, 10):
                if x * day == month:
                    temp = str(day) + str(x)
                    temp = int(temp)
                    if temp <= d:
                        res.append(temp)
    return len(res)
 
 
print(calendar())
A, B = map(int, input().split())
import sys
b = format(B, 'b')
num = len(b)

cnt1 = [0]*num
for i in range(1, num):
    if (B+1)%(2**(i+1)) <= 2**i:
        continue
    else:
        if (B+1)%2 == 1:
            cnt1[i] = 1
if B % 4 == 1 or B % 4 == 2:
    cnt[0] = 1

c = ''
if A == 0:
    for i in range(num):
        if cnt1[i] == 0:
            c = '0' + c
        else:
            c = '1' + c
    print(int(c, 2))
    sys.exit()

if A == B:
    print(0)
    sys.exit()

cnt2 = [0]*num
for i in range(1, num):
    if A%(2**(i+1)) <= 2**i:
        continue
    else:
        if A%2 == 1:
            cnt2[i] = 1
if (A-1) % 4 == 1 or (A-1) % 4 == 2:
    cnt2[0] = 1

for i in range(num):
    if cnt1[i] == cnt2[i]:
        c = '0' + c
    else:
        c = '1' + c
print(int(c, 2))

### FIXED CODE ###

import sys
A, B = map(int, input().split())

b = format(B, 'b')
num = len(b)
cnt1 = [0]*num
for i in range(1, num):
    if (B+1)%(2**(i+1)) <= 2**i:
        continue
    else:
        if (B+1)%2 == 1:
            cnt1[i] = 1
if B % 4 == 1 or B % 4 == 2:
    cnt1[0] = 1

c = ''
if A == 0:
    for i in range(num):
        if cnt1[i] == 0:
            c = '0' + c
        else:
            c = '1' + c
    print(int(c, 2))
    sys.exit()

cnt2 = [0]*num
for i in range(1, num):
    if A%(2**(i+1)) <= 2**i:
        continue
    else:
        if A%2 == 1:
            cnt2[i] = 1
if (A-1) % 4 == 1 or (A-1) % 4 == 2:
    cnt2[0] = 1

for i in range(num):
    if cnt1[i] == cnt2[i]:
        c = '0' + c
    else:
        c = '1' + c
print(int(c, 2))
print((int(input())+int(input())*int(input())//2)

### FIXED CODE ###

print((int(input())+int(input()))*int(input())//2)
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  dic[a[i]] += 1
q = int(input())
ans = [sum(a)]
for i in range(q):
  b, c = map(int, input().split())
  ans.append(ans[-1] + (c - b) * dic[b])
  dic[c] += dic[b]
  dic[b] = 0
for i in range(1, q + 1):
  print(ans[i])

### FIXED CODE ###

k = [i for i in range(1, 10 ** 5 + 1)]
v = [0] * (10 ** 5)
dic = {key: val for key, val in zip(k, v)}
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  dic[a[i]] += 1
q = int(input())
ans = [sum(a)]
for i in range(q):
  b, c = map(int, input().split())
  ans.append(ans[-1] + (c - b) * dic[b])
  dic[c] += dic[b]
  dic[b] = 0
for i in range(1, q + 1):
  print(ans[i])
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    A = [-1 for i in range(M)]
    A[0] = X

    for i in range(1,M):
        temp = A[i-1] ** 2
        temp %= M
        if temp in A:
            start = A.index(temp)
            end = i - 1
            break
        A[i] = temp

    # print(A)

    # print(start,end)
    # print(A[start],temp)

    L = end - start + 1
    straight = [0 for i in range(start)]
    loop = [0 for i in range(L)]

    np = A.index(-1)

    for i in range(start):
        if i >= np:
            break
        straight[i] = straight[i-1] + A[i]


    for i in range(L):
        if start + i >= np:
            break
        loop[i] = loop[i-1] + A[start+i]

    # print(straight)
    # print(loop)

    res = 0

    if start != 0:
        if N >= start:
            res += straight[-1]
            N -= start
        else:
            res += straight[N-1]
            N = 0

    res += (N // L) * loop[-1]

    if N % L != 0:
        res += loop[N % L - 1]

    print(res)



main()


### FIXED CODE ###

import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
from numba import njit,i8


@njit(i8[:](i8,i8[:],i8[:],i8,i8,i8))
def SerchLoop(M,A,cnt,start,end,temp):
    for i in range(1,M+2):
        temp = A[i-1] ** 2
        temp %= M
        if cnt[temp] != 0:
            start = cnt[temp]
            end = i - 1
            break
        A[i] = temp
        cnt[temp] = i
    return np.append(np.append(A,start),end)


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

    A = [-1 for i in range(M+2)]
    A[0] = X
    A = np.array(A)

    start = -1
    end = -1

    cnt = [0 for i in range(M)]
    cnt[X] = 0
    cnt = np.array(cnt)

    C = SerchLoop(M,A,cnt,start,end,0)
    A = C[:-2]
    start = C[-2]
    end = C[-1]

    L = end - start + 1

    if start == -1:
        straight = [0 for i in range(N)]
        for i in range(N):
            straight[i] = straight[i-1] + A[i]
        res = straight[-1]
    elif start == 0:
        loop = [0 for i in range(L)]
        for i in range(L):
            loop[i] = loop[i-1] + A[start+i]
        res = (N // L) * loop[-1]
        if N % L != 0:
            res += loop[N % L - 1]
    else:
        straight = [0 for i in range(start)]
        for i in range(start):
            straight[i] = straight[i-1] + A[i]
        loop = [0 for i in range(L)]
        for i in range(L):
            loop[i] = loop[i-1] + A[start+i]
        if N >= start:
            res = straight[-1]
            N -= start
        else:
            res = straight[N-1]
            N = 0
        res += (N // L) * loop[-1]
        if N % L != 0:
            res += loop[N % L - 1]

    print(res)



main()
import numpy as np
N,Q = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N-1)]
AB.reverse()
T = [[i] for i in range(N+1)]
for a,b in AB:
    T[a]+=T[b]
PQ = [list(map(int,input().split())) for _ in range(Q)]
X = np.array([0]*N)
for p,q in PQ:
    X[T[p]] = X[T[p]] + q
print(*X)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
input=lambda :sys.stdin.readline()
N,Q=map(int, input().split())
tree_dist={}
for i in range(N):
    tree_dist[i+1] = []
for i in range(N-1):
    a,b = map(int, input().split())
    tree_dist[a].append(b)
    tree_dist[b].append(a)
    
z=[0]*N
for i in range(Q):
    p,x = map(int, input().split())
    z[p-1] += x

def saiki(i,p):
    L = list(tree_dist[i])
    for l in L:
        if l != p:
            z[l-1] += z[i-1]
            saiki(l,i)
saiki(1,0)
print(" ".join(map(str,z)))
S = input()
ans = 0
for i in range(len(S)):
  for j in range(i+1, len(S)+1):
	if all('ACTG'.count(c)==1 for c in S[i:j+1]):
      ans = max(ans, j+1-i)
print(ans)


### FIXED CODE ###

import re
pattern = re.compile('[ACGT]+')
S = input()
print(len(max(re.findall(pattern, S), key=len, default='')))
import sys
input = sys.stdin.buffer.readline

def main():
    N, K = map(int,input().split())
    A = list(map(int,input().split()))
    MOD = 10**9+7
    nega, posi = [], []
    for num in A:
        if num > 0:
            posi.append(num)
        elif num < 0:
            nega.append(num)
    
    if K > len(posi)+len(nega):
        print(0)
    elif K == len(nega)+len(posi):
        ans = 1
        for num in A:
            ans *= num
            ans = (ans+MOD)%MOD
        print(ans)
    elif len(posi) == 0:
        if K%2 != 0:
            if 0 in A:
                print(0)
            else:
                nega.sort(reverse = True)
                ans = 1
                for i in range(K):
                    ans *= nega[i]
                print((ans+MOD)%MOD)
        else:
            nega.sort()
            ans = 1
            for i in range(K):
                ans *= nega[i]
            print((ans+MOD)%MOD)
    else:
        nega.sort()
        posi.sort(reverse = True)
        if K <= len(posi):
            ans = 1
            for i in range(K):
                ans *= posi[i]
            print((ans+MOD)%MOD)
            exit()
        cn = [1]
        cp = [1]
        for num in nega:
            cn.append(cn[-1]*num)
        for num in posi:
            cp.append(cp[-1]*num)
        ans = 0
        l = len(cp)
        for i in range(l):
            if K-i > len(cn):
                continue
            ret = cp[i]*cn[K-i]
            ans = max(ans, ret)
        print((ans+MOD)%MOD)
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

def main():
    N, K = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    l, r = 0, N-1
    MOD = 10**9+7
    if K == N:
        ans = 1
        for num in A:
            ans *= num
            ans = (ans+MOD)%MOD
        print((ans+MOD)%MOD)
        exit()
    elif A[-1] < 0 and K%2 == 1:
        ans = 1
        for i in range(K):
            ans *= A[-i-1]
            ans = (ans+MOD)%MOD
        print(ans)
        exit()
    ans = 1
    if K%2 == 1:
        ans *= A[-1]
        r -= 1
    for _ in range(K//2):
        nl = A[l]*A[l+1]
        nr = A[r]*A[r-1]
        if nl > nr:
            ans *= nl
            l += 2
        else:
            ans *= nr
            r -= 2
        ans = (ans+MOD)%MOD
    print(ans)
    
if __name__ == "__main__":
    main()
from collections import deque

m, k = [int(i) for i in input().split()]

if k == 0:
    q = deque([])
    for i in range(2 ** m):
        q.append(i)
        q.appendleft(i)
    print(*q)
    exit()


S = set(i for i in range(2 ** m))

q = deque([0, k])
S.remove(0)
S.remove(k)

for i in range(m):
    if (k >> i) & 1:
        if not 1 << i in S:
            print(-1)
            exit()
        q.append(1 << i)
        q.appendleft(1 << i)
        S.remove(1 << i)

q.appendleft(0)
q.append(k)

for s in S:
    q.appendleft(s)
    q.append(s)

print(*q)

### FIXED CODE ###

from collections import deque

m, k = [int(i) for i in input().split()]

if k >= 2 ** m:
    print(-1)
    exit()

if k == 0:
    q = deque([])
    for i in range(2 ** m):
        q.append(i)
        q.appendleft(i)
    print(*q)
    exit()

if m == 1 and k == 1:
    print(-1)
    exit()

S = set(i for i in range(2 ** m))

q = deque([0, k])
S.remove(0)
S.remove(k)

for s in S:
    q.appendleft(s)
    q.append(s)

q.appendleft(0)
q.append(k)

print(*q)
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    for i in list(map(lambda x: x%2019,range(l,r)):
        for j in list(map(lambda x: x%2019, range(i,r+1))):
            min = minfunc(minfunc(i,j),min)
    print(min)


### FIXED CODE ###

import sys
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    modlist = list(map(lambda x: x%2019,range(l,r+1)))
    for i in range(r-l):
        for j in range(i+1, r-l+1):
            min = minfunc((modlist[i]*modlist[j])%2019,min)
    print(min)
#!/usr/bin/env python
import math

A = [input() for i in range(5)]
min = 9
min_dish = ''
for a in A:
    if int(a[-1]) < min and int(a[-1]) != 0:
        min = int(a[-1])
        min_dish = a
sum = int(min_dish)
A.remove(min_dish)
for a in A:
    if a[-1] == '0':
        sum += int(a)
    else:
        sum += int(a) + 10 - int(a[-1])
print(int(sum))

### FIXED CODE ###

#!/usr/bin/env python

A = [input() for i in range(5)]
m = 9
flag = True
for a in A:
    if int(a[-1]) == 0:
        pass
    elif int(a[-1]) <= m:
        flag = False
        m = int(a[-1])
        min_dish = a
B = [int(i) for i in A]
if flag:
    min_dish = str(min(B))
sum = int(min_dish)
A.remove(min_dish)
for a in A:
    if int(a[-1]) == 0:
        sum += int(a)
    else:
        sum += int(a) + int(10) - int(a[-1])
print(int(sum))
N,Q=map(int, input().split())
tree_dist={}
for i in range(N):
    tree_dist[i+1] = set()
for i in range(N-1):
    a,b = map(int, input().split())
    tree_dist[a].add(b)
    tree_dist[b].add(a)
    
PX=[list(map(int, input().split())) for i in range(Q)]
z=[0]*N
for p,x in PX:
    z[p-1] += x

def saiki(i,p):
    print(i)
    L = list(tree_dist[i])
    for l in L:
        if l == p:
            continue
        z[l-1] += z[i-1]
        saiki(l,i)
saiki(1,0)
print(*z)



### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
input=lambda :sys.stdin.readline()
N,Q=map(int, input().split())
tree_dist={}
for i in range(N):
    tree_dist[i+1] = []
for i in range(N-1):
    a,b = map(int, input().split())
    tree_dist[a].append(b)
    tree_dist[b].append(a)
    
z=[0]*N
for i in range(Q):
    p,x = map(int, input().split())
    z[p-1] += x

def saiki(i,p):
    L = list(tree_dist[i])
    for l in L:
        if l != p:
            z[l-1] += z[i-1]
            saiki(l,i)
saiki(1,0)
print(" ".join(map(str,z)))
import sys

sys.setrecursionlimit(10**8)

dx = (1, 0, -1, 0,)
dy = (0, 1, 0, -1,)

inf = 1<<60

def solve():
    def dfs(i, j, depth, a, visited):
        if depth > k:
            return

        nonlocal ans
        ans = min(ans, h - 1 - i, i, w - 1 - j, j)
        visited[i][j] = True

        for l in range(len(dx)):
            ni = i + dy[l]
            nj = j + dx[l]

            if 0 <= ni < h and 0 <= nj < w:
                if (not visited[ni][nj]) and a[ni][nj]:
                    dfs(ni, nj, depth + 1, a, visited)

    h, w, k = map(int, sys.stdin.readline().split())

    si = -1
    sj = -1

    a = [[False]*w for i in range(h)]

    for i in range(h):
        s = sys.stdin.readline().rstrip()

        for j, ch in enumerate(s):
            if ch == '.':
                a[i][j] = True
            elif ch == 'S':
                a[i][j] = True
                si, sj = i, j

    visited = [[False]*w for i in range(h)]
    ans = inf

    dfs(si, sj, 0, a, visited)

    assert ans < inf

    ans = (ans + k - 1) // k  + 1

    print(ans)

if __name__ == '__main__':
    solve()

### FIXED CODE ###

import sys
from collections import deque

dx = (1, 0, -1, 0,)
dy = (0, 1, 0, -1,)

inf = 1<<60

def solve():
    h, w, k = map(int, sys.stdin.readline().split())

    si = -1
    sj = -1

    a = [[False]*w for i in range(h)]

    for i in range(h):
        s = sys.stdin.readline().rstrip()

        for j, ch in enumerate(s):
            if ch == '.':
                a[i][j] = True
            elif ch == 'S':
                a[i][j] = True
                si, sj = i, j

    visited = [[False]*w for i in range(h)]
    visited[si][sj] = True

    nxts = deque([(si, sj, 0)])

    ans = inf

    while nxts:
        i, j, d = nxts.popleft()

        ans = min(ans, i, h - 1 - i, j, w - 1 - j)

        for l in range(len(dx)):
            ni = i + dy[l]
            nj = j + dx[l]

            if 0 <= ni < h and 0 <= nj < w and not visited[ni][nj] and a[ni][nj] and d + 1 <= k:
                visited[ni][nj] = True
                nxts.append((ni, nj, d + 1))

    ans = (ans + k - 1) // k + 1

    print(ans)

if __name__ == '__main__':
    solve()
N = int(input())
A = [int(a) for a in input().split()]

import numpy as np

mod = 10**9 + 7

mesh = np.array(np.meshgrid(A, A), dtype=np.int64)
comb = mesh.T.reshape(-1, 2)

t_comb = []
for c in comb:
    if c[0] == c[1]:
        continue
    else:
        t_comb.append(sorted(c))

t_comb = np.unique(t_comb, axis=0)

summa = 0
for c in t_comb:
    summa += c[0] * c[1]

print(summa % mod)

### FIXED CODE ###

N = int(input())
A = [int(a) for a in input().split()]

mod = 10**9 + 7

print(((sum(A)**2 - sum([i**2 for i in A]))//2) % mod)
N,M = map(int,input().split(' '))
A = list(map(int,input().split(' ')))
B =[]
C =[]

l = [list(map(int,input().split())) for i in range(M)]

A.sort()
l = sorted(l,key = lambda x:x[1])

ttl = 0
m_score = 0
flag =False
for i in l[::-1]:
    p = i[0]
    k = i[1]
    ttl+=p
    t = ttl-1
    if t>=N:
        print("WA")
        for n,j in enumerate(i[t-p+1:]):
            if j<k:
                m_score+=p
                break
        m_score += sum(A[t-p+1+n:])
        flag = True
        break
    if A[t]<k:
        m_score += p*k
        continue
    else:
        for n,j in enumerate(A[t-p+1:t+1]):
            if j>k:
                flag = True
                break
        if flag:
            m_score += k*n+sum(A[t-p+1+n:])
            break
if not flag:
    if ttl<N:
        m_score += sum(A[ttl:])
print(m_score)

### FIXED CODE ###

N,M = map(int,input().split(' '))
A = list(map(int,input().split(' ')))
l = [list(map(int,input().split())) for i in range(M)]

A.sort()
l = sorted(l,key = lambda x:x[1])

ind =0
for b,c in l[::-1]:
    mx = min(N,ind+b)
    for i in range(ind,mx):
        if c>A[i]:
            A[i] = c
    if mx==N:
        break
    ind += b
print(sum(A))
import Decimal
import math

def main():
    x = int(input())
    y = 0
    p = Decimal(100)
    while p < x:
        p *= Decimal(1.01)
        p = math.floor(p) 
        y += 1

    print(y)

main()


### FIXED CODE ###

from decimal import Decimal
import math

def main():
    x = Decimal(input())
    y = 0
    p = Decimal(100)
    gr = Decimal('1.01')
    while p < x:
        p *= gr 
        p = math.floor(p) 
        y += 1

    print(y)

main()
class AtCoDeer:
    def __init__(self):
        self.pos = {"x": 0, "y": 0}
        self.time = 0

    def move(self, to_x, to_y):
        self.pos = {"x": to_x, "y": to_y}
        return self.pos

    def can_move(self, t, to_x, to_y):
        dx = abs(to_x-self.pos.get("x"))
        dy = abs(to_y-self.pos.get("y"))
        total_move = dx + dy
        dt = t - self.time

        if dt < total_move:
            return False
        elif (dt-total_move) % 2 != 0:
            return False
        else:
            self.move(to_x, to_y)
            self.time = t
            return True


def main():
    n = int(input()) - 1
    at_co_deer = AtCoDeer()

    while(at_co_deer.can_move(*[int(x) for x in input().split()])):
        if n =< 0:
            break
        elif n > 0:
            n -= 1
    
    # 計画破綻判明後のデータ読み捨て
    for i in range(n):
        input()

    if n == 0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

### FIXED CODE ###

class AtCoDeer:
    def __init__(self):
        self.pos = {"x": 0, "y": 0}
        self.time = 0

    def move(self, to_x, to_y):
        self.pos = {"x": to_x, "y": to_y}
        return self.pos

    def can_move(self, t, to_x, to_y):
        dx = abs(to_x-self.pos.get("x"))
        dy = abs(to_y-self.pos.get("y"))
        total_move = dx + dy
        dt = t - self.time

        if dt < total_move:
            return False
        elif (dt-total_move) % 2 != 0:
            return False
        else:
            self.move(to_x, to_y)
            self.time = t
            return True


def main():
    n = int(input())
    at_co_deer = AtCoDeer()

    while(at_co_deer.can_move(*[int(x) for x in input().split()])):
        n -= 1
        if n == 0:
            break
    
    # 計画破綻判明後のデータ読み捨て
    for i in range(n-1):
        input()

    if n == 0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
N = int(input())
S = input()

ans = ''

for x in S
	num=(ord(x) + N)
  	if(num >90):
    	num=64+num%90
    ans += chr(num)
print(ans)



### FIXED CODE ###

cal = {"SUN":0,"MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SAT":6,}

S=input()
print(7-cal[S])
x=int(input())
cac=0
cwa=0
tle=0
cre=0

for i in range(0,x):
    moji=input()
    if(moji=='AC'):
        cac+=1
    if(moji=='WA'):
        cwa+=1
    if(moji=='TLE'):
        ctle+=1
    if(moji=='RE'):
        cre+=1
print('AC x ',cac)
print('WA x' ,cwa)
print('TLE x ',ctle)
print('RE x' ,cre)

### FIXED CODE ###

x=int(input())
cac=0
cwa=0
ctle=0
cre=0

for i in range(0,x):
    moji=input()
    if(moji=='AC'):
        cac+=1
    if(moji=='WA'):
        cwa+=1
    if(moji=='TLE'):
        ctle+=1
    if(moji=='RE'):
        cre+=1
print('AC x ',cac)
print('WA x' ,cwa)
print('TLE x ',ctle)
print('RE x' ,cre)
from collections import defaultdict

def foo():
	H, W = map(int, input().split())
	s = ""
	for _ in range(H):
		s += input()

	counter = defaultdict(int)
	for c in s:
		counter[c] += 1

	x1, x2 = H // 2, H % 2
	y1, y2 = W // 2, W % 2

	n = x1 * y1
	k = 0
	for c in counter:
		if k == n:
			break
		if counter[c] >= 4:
			k += 1
			counter[c] -= 4

	if k != n:
		print("No")
		return

	if x2 == 1:
		n = x1
		k = 0
		for c in counter:
			if k == n:
				break
			if counter[c] >= 2:
				k += 1
				counter[c] -= 2
		if k != n:
			print("No")
			return
	if y2 == 1:
		n = y1
		k = 0
		for c in counter:
			if k == n:
				break
			if counter[c] >= 2:
				k += 1
				counter[c] -= 2
		if k != n:
			print("No")
			return
	print("Yes")

foo()



### FIXED CODE ###

S = input()
if len(S) < 4:
    print("No")
elif S[0:4] == "YAKI":
    print("Yes")
else:
    print("No")
print(max(int(input()) - int(input()), 0))


### FIXED CODE ###

x, t = list(map(int, input().split()))
print(max((x - t), 0))