Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    def all_group_size(self):
        return [len(self.members(r)) for r in self.roots()]
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
n,m = map(int,input().split())
tree = UnionFind(n)
for _ in range(m):
    i,j = map(int, input().split())
    tree.union(i-1,j-1)

print(max(tree.all_group_size()))

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    
    def all_group_size(self):
        return [len(self.members(r)) for r in self.roots()]
    
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
n,m = map(int,input().split())
tree = UnionFind(n)
ans = 1
for _ in range(m):
    i,j = map(int, input().split())
    tree.union(i-1,j-1)
    ans = max(ans,tree.size(i-1))
print(ans)
### BUGGY CODE ###


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

if a>b:
    c = a
else: c = b

while(True):
    if((c%a==0)and(c%b==0)):
        lcm = c
        break
    c+=1
print(lcm)
    

### FIXED CODE ###


def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 
def lcm(a,b): 
    return (a*b) / gcd(a,b) 

a,b = input().split()
a = int(a)
b = int(b)
print(int(lcm(a,b)))
### BUGGY CODE ###

n,k,q = map(int,input().split())
l = []
l2 = []
for i in range(q):
    l.append(int(input()))
for i in range(0,n):
    l2.append(l.count(i+1))
for i in range(0,n):
    if k + l2[i] - q>0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n,k,q = map(int,input().split())
l = [0]*n
l2 = []
for i in range(q):
    l[int(input())-1] += 1
for i in range(0,n):
    if k + l[i] - q>0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

candidates = pow(10, 6)
K = int(input())
num = "7"
if K % 2 == 0:
    print (-1)
else:
    flag = False
    for i in range(candidates):
        if int(num) % K == 0:
            flag = True
            break
        num += "7"
    if flag:
        print (i + 1)
    else:
        print(-1)

### FIXED CODE ###

limit = pow(10, 7)
K = int(input())
num = "7"
if K % 2 == 0 or K % 5 == 0:
    print (-1)
else:
    total = 0
    flag = False
    for i in range(1, limit + 1):
        total = (total * 10 + 7) % K
        if total == 0:
            flag = True
            break
    if flag:
        print (i)
    else:
        print(-1)
### BUGGY CODE ###

t = input()
l = len(t)
cnt = 0
ans = ''
for i in range(len(t)):
    if t[i] == 'P' or t[i] == 'D':
        ans += t[i]
    else:
        ans += 'D'
print(ans)

### FIXED CODE ###

t = input()
print(t.replace('?', 'D'))
### BUGGY CODE ###

N=int(input())

a=[]
for i in range(1,N):
    a.append(i)

print(sum(a))


### FIXED CODE ###

N=int(input())
print(N*(N-1)//2)
### BUGGY CODE ###

from collections import deque
import sys
sys.setrecursionlimit(100000)

def copyDeque(d):
    x = deque()
    for i in d:
        x.append(i)
    return x

def cndP(w):
    if len(w)>1:
        x = w.pop()
        cndP(copyDeque(w))
        w.append(x)
        s = 0
        while(len(w)>0):
            s += w.pop()
            st.add(s)
    else:
        st.add(w[0])
        
def pIsAccptbl(w,k,p):
    tr = 0
    c = 0
    d = copyDeque(w)
    while(d):
        tmp = d.popleft()
        if(tmp > p):
            return False
        
        if( tr + tmp > p):
            tr = tmp
            c += 1
        else:
            tr += tmp
        if c+1>k:
            return False
    return True

n,k = [int(x) for x in input().split()]
w = deque()
for i in range(n):
    w.append(int(input()))
    
st = set()
cndP(copyDeque(w))

sorted_st = sorted(st)
for i in sorted_st:
    if pIsAccptbl(w,k,i):
        print(i)
        break

### FIXED CODE ###

from collections import deque

def isPa(w,k,p):
    tr = 0
    c = 0
    d = deque(w)
    while(d):
        tmp = d.popleft()
        if(tmp > p):
            return False
        
        if( tr + tmp > p):
            tr = tmp
            c += 1
        else:
            tr += tmp
        if c+1>k:
            return False
    return True

def MaxInP(w,k,p):
    maxinp = 0
    tmp = 0
    d = deque(w)
    while(d):
        tmp += d.popleft();
        if(tmp > p):
            if(tmp > maxinp):
                maxinp = tmp
            tmp = 0
    return maxinp

n,k = [int(x) for x in input().split()]
w = deque()
for i in range(n):
    w.append(int(input()))
    
mean = int(sum(w)/k)
maxinp = MaxInP(w,k,mean)

if k == 1:
    print(mean)
else:
    minP = mean
    maxP = maxinp
    while(True):
        m = int ((minP + maxP)/2)
        if ( isPa(w,k,m) ):
            maxP = m
        else:
            minP = m
        if (minP+1 == maxP or minP == maxP):
            print(maxP)
            break
### BUGGY CODE ###

def main():
  _max = max
  s = input()
  t = input()
  slen = len(s)
  tlen = len(t)
  dp = [[0 for j in range(tlen + 1)] for i in range(slen + 1)]
  for i in range(slen):
    dpi = dp[i]
    dpi1 = dp[i + 1]
    for j in range(tlen):
      if s[i] == t[j]:
        dpi1[j + 1] = _max(dpi1[j + 1], dpi[j] + 1, dpi1[j], dpi[j + 1])
      else:
        dpi1[j + 1] = _max(dpi1[j + 1],             dpi1[j], dpi[j + 1])
  result = ''
  i = slen
  j = tlen
  while i > 0 and j > 0:
    if dp[i - 1][j] == dp[i][j]:
      i -= 1
    elif dp[i][j - 1] == dp[i][j]:
      j -= 1
    else:
      result = s[i - 1] + result
      i -= 1
      j -= 1
  print(result)
main()


### FIXED CODE ###

s = input()
t = input()
slen = len(s)
tlen = len(t)
dp = [[0 for j in range(tlen + 1)] for i in range(slen + 1)]
for i in range(slen):
  for j in range(tlen):
    if s[i] == t[j]:
      dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + 1)
    dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i + 1][j])
    dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j + 1])
result = ''
i = slen
j = tlen
while i > 0 and j > 0:
  if dp[i - 1][j] == dp[i][j]:
    i -= 1
  elif dp[i][j - 1] == dp[i][j]:
    j -= 1
  else:
    result = s[i - 1] + result
    i -= 1
    j -= 1
print(result)
### BUGGY CODE ###

N, Q = map(int,input().split()) # 複数の数字を変数に格納
List_ab = [list(map(int,input().split())) for i in range(N-1)] # [[1,2],[3,4],[5,6]]
List_px = [list(map(int,input().split())) for i in range(Q)] # [[1,2],[3,4],[5,6]]

count_list = [0]*N

List_ab.sort()
List_px.sort()

for i in range(Q):
    p = List_px[i][0]
    x = List_px[i][1]
    count_list[p-1] += x
        
for i in range(N-1):
    a = List_ab[i][0]
    b = List_ab[i][1]
    count_list[b-1] += count_list[a-1]
    
print(*count_list)

### FIXED CODE ###

N, Q = map(int,input().split()) # 複数の数字を変数に格納
List_ab = [list(map(int,input().split())) for i in range(N-1)] # [[1,2],[3,4],[5,6]]
List_px = [list(map(int,input().split())) for i in range(Q)] # [[1,2],[3,4],[5,6]]

count_list = [0]*N

List_ab.sort()

for i in range(Q):
    count_list[List_px[i][0]-1] += List_px[i][1]
        
for i in range(N-1):
    count_list[List_ab[i][1]-1] += count_list[List_ab[i][0]-1]
    
print(*count_list)
### BUGGY CODE ###

from operator import mul
from functools import reduce

def cmb(n,r):
	r = min(n-r,r)
	if r == 0: return 1
	over = reduce(mul, range(n, n - r, -1))
	under = reduce(mul, range(1,r + 1))
	return over // under

#from math import factorial

if __name__ == "__main__":
	n=int(input())
	string_list=[]

	for _ in range(n):
		rel = sorted(list(input()))
		string_list.append(''.join(rel))
	    
	string_distinct = set(string_list)
	idx = 0
	for item in string_distinct:
		s_count = string_list.count(item)
		if s_count > 1:
			idx += cmb(s_count,2)
	print(idx)




### FIXED CODE ###

N = int(input())

def sort_alpabetical(s):
	
	s_list = list(s)
	s_list.sort()
	return ''.join(s_list)

list_s = []
for n in range(N):
	list_s.append(input())

list_s = [sort_alpabetical(s) for s in list_s]

dict_s = {s : 0 for s in set(list_s)}

n_of_pairs = 0


for s in list_s:
	
	n_of_pairs += dict_s[s]
	dict_s[s] +=1
	
print(n_of_pairs)
### BUGGY CODE ###

import collections

N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
c = collections.Counter(A)

x = K - Q
y = (-1) * x

if x > 0:
    for _ in range(N):
        print('Yes')
else:
    l = []
    for i,v in dict(c).items():
        if v > y:
            l.append(i-1)
    for j in range(N):
        if j in l:
            print('Yes')
        else:
            print('No')

### FIXED CODE ###

import collections

N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
c = collections.Counter(A)

if (K - Q) > 0:
    for _ in range(N):
        print('Yes')
else:
    l = ['No'] * N
    for i,v in dict(c).items():
        if v >(Q - K):
            l[i-1] = 'Yes'
    for j in l:
        print(j)
### BUGGY CODE ###

def get_quad(n, p):
    for ni in range(n,0,-1):
        if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
            return ni
        
def sieve():
    n = 10000001
    p = [1] * n
    p[0] = p[1] = 0
    
    for i in range(int(n ** 0.5)):
        if p[i]:
            for j in range(2 * i, len(p), i):
                p[j] = 0
    return p
import sys
f = sys.stdin

prime = sieve()
while True:
    n = f.readline()
    if not n.isnumeric():
        continue
    n = int(n)
    if n == 0:
        break
    print(get_quad(ni, prime))

### FIXED CODE ###

def get_quad(n, p):
    if n < 19:
        return 13
    n = (n + 1) // 10 * 10 - 1
    for ni in range(n,0,-10):
        if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
            return ni
        
def sieve():
    n = 10000001
    p = [1] * n
    p[0] = p[1] = 0
    
    for i in range(int(n ** 0.5)):
        if p[i]:
            for j in range(2 * i, len(p), i):
                p[j] = 0
    return p

import sys
f = sys.stdin

prime = sieve()
while True:
    n = f.readline().strip()
    if not n.isdigit():
        continue
    n = int(n)
    if n == 0:
        break
    print(get_quad(n, prime))
### BUGGY CODE ###

mod = 998244353
rng = 300100
fctr = [1]
finv = [1]
for i in range(1,rng):
  fctr.append(fctr[-1]*i%mod)

def cmb(n,k):
  if n<0 or k<0:
    return 0
  else:
    return fctr[n]*pow(fctr[n-k],mod-2,mod)*pow(fctr[k],mod-2,mod)%mod
n,a,b,k = map(int,input().split())
pair = []
for i in range(n+1):
  if (k-a*i)%b == 0 and (k-a*i)//b <= n:
    pair.append((i,(k-a*i)//b))
ans = 0
for x,y in pair:
  ans = (ans+cmb(n,x)*cmb(n,y))%mod
print(ans)

### FIXED CODE ###

mod = 998244353
rng = 300100
fctr = [1]
finv = [1]
for i in range(1,rng):
  fctr.append(fctr[-1]*i%mod)
for i in range(1,rng):
  finv.append(pow(fctr[i],mod-2,mod))
def cmb(n,k):
  if n<0 or k<0:
    return 0
  else:
    return fctr[n]*finv[n-k]*finv[k]%mod
n,a,b,k = map(int,input().split())
pair = []
for i in range(n+1):
  if (k-a*i)%b == 0 and (k-a*i)//b <= n:
    pair.append((i,(k-a*i)//b))
ans = 0
for x,y in pair:
  ans = (ans+cmb(n,x)*cmb(n,y))%mod
print(ans)
### BUGGY CODE ###

n,q = map(int,input().split())
s = input()
lr = [[int(i) for i in input().split()]for _ in range(q)]

for j in lr:
  i = s[j[0]-1:j[1]]
  print(i.count('AC'))

### FIXED CODE ###

n,q = map(int,input().split())
s = input()
lr = [[int(i) for i in input().split()]for _ in range(q)]
dp = [0]*n
f,c = 0,0
for i,j in enumerate(s):
  if f==1 and j=='C':
    c+=1
    f =0
  elif j=='A':
    f = 1
  else:
    f = 0
  dp[i]=c
for i in lr:
  print(dp[i[1]-1]-dp[i[0]-1])
### BUGGY CODE ###

s = input()
q = int(input())
q_list = [list(input().split()) for _ in range(q)]

for q in q_list:
    if q[0] == '1':
        s = s[::-1]
    else:
        if q[1] == '1':
            s = q[2] + s
        else:
            s = s + q[2]

print(s)

### FIXED CODE ###

s = input()
q = int(input())
q_list = [list(input().split()) for _ in range(q)]

top_list = []
end_list = []

flag = 1

for q in q_list:
    if q[0] == '1':
        flag *= -1
    else:
        if flag == 1:
            if q[1] == '1':
                top_list.append(q[2])
            else:
                end_list.append(q[2])
        else:
            if q[1] == '2':
                top_list.append(q[2])
            else:
                end_list.append(q[2])
if flag == 1:            
    print(''.join(top_list[::-1]) + s + ''.join(end_list))
else:
    print(''.join(end_list[::-1]) + s[::-1] + ''.join(top_list))
### BUGGY CODE ###

s = list(input())
q_num = int(input())

reversed = False

for _ in range(q_num):
    query = input().split()
    if query[0] == '1':
        reversed = False if reversed else True
    elif query[0] == '2':
        if not reversed:
            if query[1] == '1':
                s.insert(0, query[2])
            elif query[1] == '2':
                s.append(query[2])
        else:
            if query[1] == '2':
                s.insert(0, query[2])
            elif query[1] == '1':
                s.append(query[2])
if reversed:
    s.reverse()
print(''.join(s))

### FIXED CODE ###

from collections import deque
s = list(input())
q_num = int(input())

s_deq = deque(s)
reversed = False

for _ in range(q_num):
    query = input().split()
    if query[0] == '1':
        reversed = False if reversed else True
    elif query[0] == '2':
        if not reversed:
            if query[1] == '1':
                s_deq.appendleft(query[2])
            elif query[1] == '2':
                s_deq.append(query[2])
        else:
            if query[1] == '2':
                s_deq.appendleft(query[2])
            elif query[1] == '1':
                s_deq.append(query[2])
if reversed:
    s_deq.reverse()
print(''.join(s_deq))
### BUGGY CODE ###

rows, columns = map(int, input().split(' '))

result = 0
for row in range(rows):
    for column in range(columns):
        target_time = 0
        if column + 1 < columns and row + 1 < rows:
            target_time += 1
        if column + 1 < columns and 0 <= row - 1:
            target_time += 1
        if 0 <= column - 1 and row + 1 < rows:
            target_time += 1
        if 0 <= column - 1 and 0 <= row - 1:
            target_time += 1

        if 0 <= column - 1:
            target_time += 1
        if column + 1 < columns:
            target_time += 1
        if row + 1 < rows:
            target_time += 1
        if 0 <= row - 1:
            target_time += 1

        if target_time % 2 == 0:
            result += 1

print(result)

### FIXED CODE ###

rows, columns = map(int, input().split(' '))

if rows == 1 and columns == 1:
    print(1)
    exit()

if rows == 1:
    print(columns - 2)
    exit()

if columns == 1:
    print(rows - 2)
    exit()

print(rows * columns - 2 * rows - 2 * columns + 4)
### BUGGY CODE ###

a,b,k = map(int,input().split())
for i in range(k):
    a -= 1
    if a == 0 :
        b -= 1
if a > 0 :
    print(a,b)
else:
    print(0,b)

### FIXED CODE ###

a,b,k = map(int,input().split())
if a > k:
    print(a-k,b)
elif a <= k and a+b > k:
    print(0,a+b-k)
else:
    print(0,0)
### BUGGY CODE ###

N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
y_to_i = [0]*(N+1)
for i,(x,y) in enumerate(A):
  y_to_i[y] = i
A.sort()
ans = [0]*N
from bisect import *
lis = []
cum_max = N

for x,y in A:
  insort(lis,y)
  lis_max,lis_min = lis[-1],lis[0]
  if lis_max==cum_max and len(lis)==lis_max-lis_min+1:
    for y1 in lis:
      ans[y_to_i[y1]] = len(lis)
    cum_max = lis_min-1
    lis = []
print(*ans, sep='\n')


### FIXED CODE ###

class UnionFind():
  def __init__(self, n):
    self.n = n
    self.parents = [-1] * n
    self.min_y = [N]*n

  def find(self, x):
    if self.parents[x] < 0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
    return self.parents[x]

  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)

    if x == y:
      return

    if self.parents[x] > self.parents[y]:
      x, y = y, x

    self.parents[x] += self.parents[y]
    self.min_y[x] = min(self.min_y[x],self.min_y[y])
    self.parents[y] = x

  def same(self, x, y):
    return self.find(x) == self.find(y)

  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]

  def num_roots(self):
    return len([i for i, x in enumerate(self.parents) if x < 0])

  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.n) if self.find(i) == root]

  def num_members(self,x):
    return abs(self.parents[self.find(x)])

  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

import sys,os,io
input = sys.stdin.readline
# input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
N = int(input())
A = [list(map(int, input().split()))+[i] for i in range(N)]
uf = UnionFind(N)
uf.min_y = [y for x,y,i in A]
ans = [1]*N
A.sort()
Y = [(i,y) for x,y,i in A]
from heapq import *
heap = []
for u,y in Y:
  atode = []
  for _ in range(len(heap)):
    y1,v = heappop(heap)
    if y<y1:
      heappush(heap,(y1,v))
      break
    uf.union(u,v)
    if uf.parents[v]<0:
      atode.append((uf.min_y[v],v))
  if uf.parents[u]<0:
    heappush(heap,(uf.min_y[u],u))
  for y1,v in atode:
    heappush(heap,(y1,v))
for i in range(N):
  ans[i] = uf.num_members(i)
print(*ans, sep='\n')
### BUGGY CODE ###

import sys
sys.setrecursionlimit(1000000)
class Node:
    def __init__(self):
        self.next=[]
    def get_data(self,new_next,weight=1):
        self.next.append(new_next)
def BFS(i,depth,K):  
    depth+=1
    tmp=i
    seki=1
    if depth==1:
        calc=K-1
        diff=0
        #for i in range(calc,max(1,calc-(len(tmp)-diff)),-1):
        for i in range(calc,calc-(len(tmp)-diff),-1):
            seki*=i
        
    else:
        calc=K-2
        diff=1
        for i in range(calc,calc-(len(tmp)-diff),-1):
            seki*=i
            
    for each in tmp:
        if not check_node[each]:
            check_node[each]=True
            seki*=BFS(node[each].next,depth,K)%1000000007
    return seki


N,K=list(map(int,input().split()))
node=[Node() for _ in range(N)]
check_node=[False for _ in range(N)]
check_node[0]=True
for i in range(N-1):
    p,n=list(map(int,input().split()))
    node[n-1].get_data(p-1)
    node[p-1].get_data(n-1)
start=0
d=0

com=K*BFS(node[0].next,d,K)
print(com%1000000007)

### FIXED CODE ###

import sys
import math
sys.setrecursionlimit(1000000)
mod=1000000007
class Node:
    def __init__(self):
        self.next=[]
    def get_data(self,new_next,weight=1):
        self.next.append(new_next)
def BFS(i,depth,K):  
    depth+=1
    tmp=i
    seki=1
    num=len(tmp)
    if depth==1:
        calc=K-1
        loop=range(calc,calc-num,-1)
        for i in loop:
            seki*=i%1000000007

        
    else:
        calc=K-2
        num-=1
        if calc>=num:
            seki=cache[num]
        else:
            print(0)
            exit()

            
            
    for each in tmp:
        if not check_node[each]:
            check_node[each]=True
            seki*=BFS(node[each].next,depth,K)%mod
    return seki


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

if K>2:
    cache=[0 for i in range(K-2)]
    cache[0]=1
    for i in range(1,K-2):
        cache[i]=cache[i-1]*(K-1-i)%mod
    cache.append(cache[-1])
else:
    cache=[1,1]
node=[Node() for _ in range(N)]
check_node=[False for _ in range(N)]
check_node[0]=True
for i in range(N-1):
    p,n=list(map(int,input().split()))
    node[n-1].get_data(p-1)
    node[p-1].get_data(n-1)
start=0
d=0

com=K*BFS(node[0].next,d,K)
print(int(com)%mod)
### BUGGY CODE ###

from collections import Counter
a=open(0)
n=int(a.readline())
l=a.read().split()
c=Counter(l)
max_list=[k for k,v in c.items() if v==max(c.values())]
max_list.sort()
print(*max_list,sep="\n")

### FIXED CODE ###

n = int(input())
s = [input() for _ in range(n)]
d = {}
for w in s:
    if w not in d:
        d[w] = 0
    d[w] += 1
d2 = sorted(d.items(), key=lambda x:x[1], reverse=True)
maxcnts = [w[0] for w in d2 if w[1] == d2[0][1]]
maxcnts.sort()
for ans in maxcnts:
    print(ans)
### BUGGY CODE ###

n, m = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
for i in range(m):
    a[a.index(max(a))] = max(a)//2
print(sum(a))

### FIXED CODE ###

import heapq
n, m = (int(i) for i in input().split())
a = [int(i) * (-1) for i in input().split()]
heapq.heapify(a)
for i in range(m):
    tmp_min = ((a[0] * (-1)) //2) * (-1)
    heapq.heappushpop(a,tmp_min)
print(abs(sum(a)))
### BUGGY CODE ###

import itertools
n,y = map(int,input().split())
for i,j,k in itertools.product(range(0,n+1),range(0,n+1),range(0,n+1)):
  sum_y = 10000*i + 5000*j + 1000*k
  sum_n = i+j+k
  if sum_y == y and sum_n == n:     
    print(i,j,k)
    break
else:
  print(-1,-1,-1)



### FIXED CODE ###

import itertools
n,y = map(int,input().split())
for i,j in itertools.product(range(0,n+1),range(0,n+1)):
  c = n-i-j
  sum_y = 10000*i + 5000*j + 1000*c
  if sum_y == y and c>=0:     
    print(i,j,c)
    break
else:
  print(-1,-1,-1)
### BUGGY CODE ###

# O(n) solution (Accepted)
# Author : code_marshal

n, k = map(int, input().split())
a = list(map(int, input().split()))
m, j = 1, 0
for i in range(n):
    m*=a[i]
    if i>=k:
        n = m//a[i]
        m//=a[j]
        j+=1
        if n<m: print('Yes')
        else: print('No')

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
    if i>=k:
      if a[i]>a[i-k]: print('Yes')
      else: print('No')
### BUGGY CODE ###

import queue

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

if N!=0:
    p = list(map(int,input().split()))
else:
    p=[]

q = queue.Queue()

q.put(X)

while True:
    t = q.get()
    if t in p:
        q.put(t-1)
        q.put(t+1)
    else:
        print(t)
        break


### FIXED CODE ###

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

if N!=0:
    p = list(map(int,input().split()))
else:
    p=[]

d = {n: 1 for n in p}

a = X
b = X
while True:
    if d.get(a) != 1:
        print(a)
        break
    elif d.get(b) != 1:
        print(b)
        break
    else:
        a -= 1
        b += 1