Harryxun/stf_run huggingface dataset:
X = int(input())
Y = int(input())

x = X + Y/2
print(str(x))

### FIXED CODE ###

X,Y = map(int,input().split())
print(X+Y//2)
N = int(input())
X = map(int, input().split())
 
ans = 100000
for i in range(100):
  s = 0
  for j in range(N):
    s += (X[j]-i)**2
    
  ans = min(ans, s)
  
print(ans)

### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
 
ans = 10000000000
for i in range(100):
  s = 0
  for j in range(N):
    s += (X[j]-i)**2
    
  ans = min(ans, s)
  
print(ans)
#%%
class Node():
    
    def __init__(self):
        self.parent = -1
        self.left = -1
        self.right = -1
        self.value = 0
        
    @classmethod
    def get_parent_children(cls, node_data):
        
        if instance_list[node_data[0]].left == -1:
            instance_list[node_data[0]].left = node_data[1]
        elif instance_list[node_data[0]].right == -1:
            instance_list[node_data[0]].right = node_data[1]
            
        instance_list[node_data[1]].parent = node_data[0]
        
def DFS_138(u, value):
    if u == -1:
        return 
    
    instance_list[u].value = instance_list[u].value + value
    DFS_138(instance_list[u].left, value)
    DFS_138(instance_list[u].right, value)
    
#%%
N, Q = [int(i) for i in input().split()]
node_data = [[] for _ in range(N - 1)]
for i in range(N - 1):
    node_data[i] = [int(i) - 1 for i in input().split()]
    
value_data = [[] for _ in range(Q)]
for i in range(Q):
    value_data[i] = [int(i) for i in input().split()]
    value_data[i][0] -= 1
#%%
instance_list = [Node() for _ in range(N)]

for i in node_data:
    Node.get_parent_children(i)
    
for i in value_data:
    DFS_138(i[0], i[1])
#%%
ans = [instance_list[i].value for i in range(N)]
print(" ".join(map(str, ans)))


### FIXED CODE ###

# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

#n = int(input())
n,q = [int(i) for i in readline().split()]

g = [[] for _ in range(n)]
for i in range(n-1):
    a,b = [int(i) for i in readline().split()]
    g[a-1].append(b-1)
    g[b-1].append(a-1)

add = [0]*n
for _ in range(q):
    p,x = [int(i) for i in readline().split()]
    add[p-1] += x

ans = [0]*n
#ans[0] = add[0]

def dfs(v,p,value): #p: parent of v
    value += add[v]
    ans[v] = value
    for c in g[v]:
        if c == p: continue
        dfs(c,v,value)

dfs(0,-1,0)

#print(add)

print(*ans)
import numpy as np

N = input()
T,A = map(int,input().split())
li = input().split()

celsiuses = []
for i for li:
	celsius = T-li[i]*0.006
	celsiuses.append(celsius)

def getNearValue(list, num):
	idx = np.abs(np.asarray(list) - num).argmin()
	return list[idx]

if __name__ = "__main__":

ans = getNearValue(celsiuses, A)

ans += 1

print(ans)

### FIXED CODE ###

x, y = map(int, input().split())
print(x + y//2)
import math

def lcm(n, m):
    return int(n * m / math.gcd(n, m))


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(int(time), t_sorted[i])

print(int(time))

### FIXED CODE ###

def gcd(n, m):
    if min(n, m) == 0:
        return max(n,m)
    else:
        return gcd(min(n,m), max(n,m) % min(n,m))

def lcm(n, m):
    return n * m // gcd(n, m)


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(time, t_sorted[i])

print(int(time))
a,b,c = map(int,input().split())
x = c - (a - b)
print(x if x > 0 else 0)4

### FIXED CODE ###

a,b,c = [int(x) for x in input().split()]
i = c - (a - b)
if i < 0:
  print(0)
else :
  print(i)
class Solution(object):
	def __init__(self):
		self.ans = 0
	def search(self, pos, dest):
		if(pos > dest):
			return
		if(pos == dest):
			self.ans += 1
			return
		self.search(pos+1, dest)
		self.search(pos+2, dest)

N, M = map(int, input().split())
A = []

prev = 0

for i in range(M):
	curr = int(input())
	A.append(curr)
	#prev = curr

A.append(N+1)

#print(A)

ans = 1

prev = 0
for i in range(len(A)):
	s = Solution()
	if(i == 0):
		prev = 0
	else:
		prev = A[i-1] + 1
	#print(prev)
	s.search(prev,A[i]-1)
	con = s.ans
	#print(con)
	ans *= con

print(ans % 1000000007)




### FIXED CODE ###

N, M = map(int, input().split())
A = []
for i in range(M):
	curr = int(input())
	A.append(curr)

mod = 1000000007

ans = [0] * (N + 1)

ans[0] = 1

for a in A:
	ans[a] = -1

for i in range(len(ans)):
	if ans[i] == -1:
		continue
	if(i+1 < len(ans) and ans[i+1] != -1):
		ans[i+1] += ans[i]
		ans[i+1] %= mod
	if(i+2 < len(ans) and ans[i+2] != -1):
		ans[i+2] += ans[i]
		ans[i+2] %=mod

print(ans[N])
N=int(input())
an=list(map(int,input().split()))
n=0
for i in range(N):
    if an%2==0:
        n+=1
print(an/2)

### FIXED CODE ###

N=int(input())
an=list(map(int,input().split()))
n=0
while(all(a%2==0 for a in an)):
    an=[a//2 for a in an]
    n+=1
print(n)
n, k = map(int, input().split())
A = list(map(int, input().split()))
def f(L):
    if A[L[-1]-1] not in L:
        L_next = L + [A[L[-1]-1]]
        return f(L_next)
    else:
      return L
L = [1]
P = f(L)
a = A[P[-1]-1]
j = P.index(a)
r = len(P)
l = r - j
if k+1 <= j:
    print(P[k])
else:
    print(P[j+(k-j)%l])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n, k = map(int, input().split())
A = list(map(int, input().split()))
L = [1]
S = {1}

def f(L, S):
    last = L[-1]-1
    if A[last] not in S:
        L.append(A[last])
        S |= {A[last]}
        return f(L, S)
    else:
        return L
P = f(L, S)
a = A[P[-1]-1]
j = P.index(a)
r = len(P)
l = r - j

if k+1 <= j:
    print(P[k])
else:
    print(P[j+(k-j)%l])
A = input(int())
B = input(int())
print(A*B)


### FIXED CODE ###

A, B=map(int, input().split())
print(A*B)
s=input()
ans=0
for i in s:
    if i in ["A","T","C","G"]:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
print(ans)

### FIXED CODE ###

s=input()
s+="Z"
ans=0
cnt=0
for i in s:
    if i in ["A","T","C","G"]:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
print(ans)
k,n=map(int,input().split())
a=list(map(int,input().split()))

ans=0
if max(a)<=(k/2.0) or min(a)>=(k/2.0):
  for i in range(n-1):
    ans+=abs(a[i+1]-a[i])
else:
  for i in range(n):
    if a[i]>k/2.0:
      a[i]-=k
    else:
      j=i
  for i in range(j):
     ans+=abs(a[i+1]-a[i])
  ans+=abs(a[n]-a[0])
  for i in range(j+1,n-1):
    ans+=abs(a[i+1]-a[i])
print(ans)

### FIXED CODE ###

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

ans=0
if max(a)<=(k/2.0) or min(a)>=(k/2.0):
  for i in range(n-1):
    ans+=abs(a[i+1]-a[i])
else:
  max_=0
  for i in range(n-1):
    max_=max(max_,abs(a[i+1]-a[i]))
  max_=max(max_,abs(a[0]-(a[n-1]-k)))
  ans=k-max_
print(ans)
a, b = map(int, input().split())
print(max[a+b, a-b, a*b])

### FIXED CODE ###

a, b = map(int, input().split())
calcu = [a+b, a-b, a*b]
print(max(calcu))
S = str(input())
if S[-1] == 's':
  S += 's'
else:
  S += 'es'
return S



### FIXED CODE ###

S = str(input())
if S[-1] != 's':
  S += 's'
else:
  S += 'es'
print(S)
N = input()
A = input().split(",")
count = 0
roop = False

while True:
    for i in range(0, int(N)):
        if int(A[i]) % 2 != 0:
            roop = True
            break
        A[i] = int(A[i]) / 2
    if roop:
        break
    count+=1


print(count)

        


### FIXED CODE ###

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


count = 0
while True:
    flag = True
    for i in range(N):
        Ai = int(A[i])
        if Ai % 2 != 0:
            flag = False
            break
        A[i] = Ai / 2
        
    if flag == False:
        break
    count += 1

print(count)
s=input()
if s=='Sunny':
  print('Cloudy')
ifelse s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')


### FIXED CODE ###

s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
def main():
    N, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    A.sort()
    maxA = A.pop()
    if maxA < K or (N == 1 and maxA != K):
        return print("IMPOSSIBLE")
    g = A[0]

    def gcd(x, y):
        if y == 0:
            return x
        while y != 0:
            x, y = y, x % y
        return x

    for a in A[1:]:
        g = gcd(g, a)

    if (maxA - K) % g == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, k = (int(i) for i in input().split())
    a = [int(i) for i in input().split()]
    a.sort()
    diff_min = 10**9 + 7
    for i in range(n-1):
        diff = abs(a[i] - a[i+1])
        diff_min = (min(diff_min,diff) if diff != 0 else diff_min)
    for i in range(n):
        diff_min = (a[i] % diff_min if a[i] % (diff_min) != 0 else diff_min)
    for i in range(n):
        if a[i] - k >= 0 and (a[i] - k)%diff_min == 0:
            print("POSSIBLE")
            break
    else:
        print("IMPOSSIBLE")
if __name__ == '__main__':
    main()
x = int(input())
flag = 0
if x < 10:
    print("Yes")
for l in range(1,10,1):
    num =x/l
    mod = x % l
    if num < 10 and mod == 0:
        flag =1
        break
if flag == 1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

x,y=map(int,input().split())
if x<10 and y<10:
    print(x*y)
else:
    print("-1")
a, b, c = map(int, input().spit())

print(min(b//a, c))


### FIXED CODE ###

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

print(min(b//a, c))
N = int(input())
items = [list(map(int, input().split())) for _ in range(N)]
v_max = 1000*100
INF = 10**18
dp = [[INF] * (v_max+1) for _ in range(N+1)]
for v in range(v_max+1):
  dp[0][v] = 0

for i in range(N):
  for v in range(v_max+1):
    if v >= items[i][1]:
      dp[i+1][v] = min(dp[i][v-items[i][1]]+items[i][0], dp[i][v])
    else:
      dp[i+1][v] = dp[i][v]

for v in range(v_max+1)[::-1]:
  if dp[N][v] <= W:
    print(v)
    break


### FIXED CODE ###

N = int(input())
nums = list(map(int, input().split()))
INF = 10**10
dp = [INF] * (N)
dp[0] = 0
dp[1] = abs(nums[1]-nums[0])
for i in range(2, N):
  dp[i] = min(dp[i-2]+abs(nums[i]-nums[i-2]), dp[i-1]+abs(nums[i]-nums[i-1]))
print(dp[N-1])
N, M = map(int, input().split())
edge = [[] for _ in range(N)]
for _ in range(M):
    x, y = map(int, input().split())
    edge[x-1].append(y-1)
dp = [0]*N
def f(v):
    if dp[v] != 0:
        return dp[v]
    res = 0
    for i in edge[v]:
        res = max(res, f(i)+1)
    dp[v] = res
    return res
for i in range(N):
    f(i)
print(max(dp))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
def f(v):
    if dp[v] != 0:
        return dp[v]
    res = 0
    for i in graph[v]:
        res = max(res,f(i)+1)
    dp[v] = res
    return res
N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for i in range(M):
    x, y = map(int, input().split())
    graph[x-1].append(y-1)
dp = [0]*N
ans = 0
for i in range(N):
    ans = max(ans,f(i))
print(ans)
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
i = 0
cnt = 0
while X - D >= 0:
  D += L[i]
  i += 1
  cnt += 1
if cnt == 0:
  print(cnt+1)
else:
  print(cnt)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
cnt = 1
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
  if X >= D[i]:
    cnt += 1
print(cnt)
N = int(input())

A = [int(_) for _ in input().split()]
ans = 0
s = A[0]

i = 1
while i < N:
    a = A[i]
    # print(i, s, ans)

    sign = (s // abs(s))
    abs_min = abs(s) + 1
    if a == 0:
        ans += abs_min
        s = -sign

        i += 1
        continue

    abs_a = abs(a)
    a_sign = (a // abs_a)
    if a_sign == sign:
        A[i] = 0
        ans += abs_a
    else:
        if abs_min <= abs_a:
            s = (abs_a - abs(s)) * a_sign
        else:
            ans += abs_min - abs_a
            s = -sign
        i += 1
print(ans)


### FIXED CODE ###

N = int(input())

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


def f(sign):
    ans = 0
    s = 0
    for i in range(N):
        a = A[i]
        s += a
        if s == 0:
            ans += 1
            s = sign
        else:
            a_sign = s // abs(s)
            if a_sign != sign:
                ans += abs(s) + 1
                s = sign
        sign *= -1
    return ans


print(min(f(1), f(-1)))
N = int(input())
A = list(map(int, input().split()))

A.sort()
cnt = [0] * (A[-1]+1)

for a in A:
  cnt[::a] += 1

ans = 0
for a in A:
  if cnt[a] == 1:
    ans += 1

print(ans)

### FIXED CODE ###

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

A.sort()
cnt = [0] * (A[-1]+1)

for a in A:
  for i in range(a, A[-1]+1, a):
    cnt[i] += 1

ans = 0
for a in A:
  if cnt[a] == 1:
    ans += 1

print(ans)
#ITP1_6_B


n= int(input())

T=[[0 for j in range(13)]for m in range(4)]
format(T)

for i in range(n):
    a,b = input().split()
    b=int(b)
    
    if a=='S':
      T[0][b-1] = 1
    elif a=='H':
      T[1][b-1] = 1
    elif a=='C':
      T[2][b-1] = 1
    else:
      T[3][b-1] = 1
c=0
c=int(c)
d=0
d=int(d)
for j in range(4):
  for i in range (13):
    if T[c][d] == 0:
      if c==0:
        K = "S"
      elif c==1:
        K = "H"
      elif c==2:
        K = "C"
      else:
        K = "D"
    print(K,d+1)
    d=d+1
  c=c+1
    


### FIXED CODE ###

#ITP1_6_B


n= int(input())

T=[[0 for j in range(13)]for m in range(4)]
format(T)

for i in range(n):
    a,b = input().split()
    b=int(b)
    
    if a=='S':
      T[0][b-1] = 1
    elif a=='H':
      T[1][b-1] = 1
    elif a=='C':
      T[2][b-1] = 1
    else:
      T[3][b-1] = 1
for c in range(4):
  for d in range (13):
    if T[c][d] == 0:
      if c==0:
        K = "S"
      elif c==1:
        K = "H"
      elif c==2:
        K = "C"
      else:
        K = "D"
      print(K,d+1)
    else:
      pass
import math

N = int(input())
N = math.factorial(N) # N!を出してくれる (N=3, 0+1+2+3=6)

i = 2 　#Nを素因数分解するためまずは2で
num = 1
ans = 1

while N != 1: 
    if N % i == 0:
        N //= i
        num += 1
    else:
        ans *= num
        num = 1
        i += 1
ans *= num
ans %= (10 ** 9) + 7

print(ans)

### FIXED CODE ###

import math

N = int(input())
N = math.factorial(N) 

i = 2 
num = 1
ans = 1

while N != 1: 
    if N % i == 0:
        N = N // i
        num += 1
    else:
        ans *= num
        num = 1
        i += 1
ans *= num
ans %= (10 ** 9) + 7

print(ans)
N = int(input())
A = list(map(int,input().split()))
B = [True]*N
count = 0
A.sort()
for i in range(N):
    if B[i]:
        for j in range(i+1,N):
            if A[i]==A[j]:
                B[j] = False
                B[i] = False
            elif A[j]%A[i]==0:
                B[j] = False
    if B[i]:
        count+=1
print(count)

### FIXED CODE ###

import sys
C = list(map(int, input().split()))
for n in range(len(C)):
  if C[n]==0:
    print(n+1)
    sys.exit()
import math

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
eight_list = []
ten_list = []
eight_min = math.ceil(A/0.08)
ten_min = math.ceil(B/0.10)
eight_list.append(eight_min)
ten_list.append(ten_min)

eight_min += 1
while(math.floor(eight_min*0.08)==A):
    eight_list.append(eight_min)
    eight_min += 1

ten_min += 1
while(math.floor(ten_min*0.10)==B):
    ten_list.append(ten_min)
    ten_min += 1

#print(eight_list)
#print(ten_list)

print(min(set(eight_list)&set(ten_list)))


### FIXED CODE ###

import math

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
eight_list = []
ten_list = []
eight_min = math.ceil(A/0.08)
ten_min = math.ceil(B/0.10)
eight_list.append(eight_min)
ten_list.append(ten_min)

eight_min += 1
while(math.floor(eight_min*0.08)==A):
    eight_list.append(eight_min)
    eight_min += 1

ten_min += 1
while(math.floor(ten_min*0.10)==B):
    ten_list.append(ten_min)
    ten_min += 1

#print(eight_list)
#print(ten_list)
try:
    print(min(set(eight_list)&set(ten_list)))
except ValueError:
    print(-1)
x,y = map(int,input().split())
 
ans = 0
for i in range(x+1):
    f = (2*i) + 4*(x-i)
    if  f == y:
        print("Yes")
        exit()
 
print("No")

### FIXED CODE ###

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

cnt = 1
for i in range(len(l)):
    if l[i] == 0:
        break
    else:
        cnt += 1
        

print(cnt)
import heapq
INF = 10**9

n = int(input())
edge = [[] for _ in range(n)]

def get_max_dist(frm, n, dist):
    val = 0
    index = -1
    for item in edge[n]:
        if item == frm:
            if len(edge[n]) == 1:
                return dist, n
            continue
        tmp, tindex = get_max_dist(n, item, dist+1)
        if val < tmp:
            val = tmp
            index = tindex
    return val, index

for i in range(n-1):
    a, b = [int(item) for item in input().split()]
    a -= 1; b -= 1
    edge[a].append(b)
    edge[b].append(a)

val, left = get_max_dist(-1, 0, 0)
diam, right = get_max_dist(-1, left, 0)

if diam % 3 == 1:
    print("Second")
else:
    print("First")

### FIXED CODE ###

import heapq
INF = 10**9

n = int(input())
edge = [[] for _ in range(n)]

class Dijkstra:
    def __init__(self, adj):
        self.adj = adj
        self.num = len(adj)
        self.dist = [INF] * self.num
        self.prev = [INF] * self.num
        self.q = []

    def reset(self):
        self.dist = [INF] * self.num
        self.prev = [INF] * self.num
        self.q = []

    def calc(self, start):
        self.dist[start] = 0
        heapq.heappush(self.q, (0, start))
        while len(self.q) != 0:
            prov_cost, src = heapq.heappop(self.q)
            if self.dist[src] < prov_cost:
                continue
            for dest in self.adj[src]:
                cost = 1
                if self.dist[dest] > self.dist[src] + cost:
                    self.dist[dest] = self.dist[src] + cost
                    heapq.heappush(self.q, (self.dist[dest], dest))
                    self.prev[dest] = src
        return self.dist 

for i in range(n-1):
    a, b = [int(item) for item in input().split()]
    a -= 1; b -= 1
    edge[a].append(b)
    edge[b].append(a)

dij = Dijkstra(edge)
dist = dij.calc(0)
left = dist.index(max(dist))
dij.reset()
dist = dij.calc(left)
diam = max(dist)
if diam % 3 == 1:
    print("Second")
else:
    print("First")
# coding: utf-8

def selectionSort(A, N):
	count = 0
	for i in xrange(N):
		minj = i
		for j in xrange(i, N):
			if A[j] < A[minj]:
				minj = j
		if minj != i:
			A[i], A[minj] = A[minj], A[i]
			count += 1
	return count

def main():
	N = input()
	A = map(int, raw_input().split())
	print selectionSort(A, 6)
	print ' '.join(map(str, A))

if __name__ == '__main__':
	

### FIXED CODE ###

# coding: utf-8

def selectionSort(A, N):
	A = A[:]
	count = 0
	for i in xrange(N):
		minj = i
		for j in xrange(i, N):
			if A[j] < A[minj]:
				minj = j
		if minj != i:
			A[i], A[minj] = A[minj], A[i]
			count += 1
	return A, count

def main():
	N = input()
	A = map(int, raw_input().split())
	sorted_, count = selectionSort(A, N)
	print ' '.join(map(str, sorted_))
	print count

if __name__ == '__main__':
	main()
from sys import exit

x, n = map(int, input().split())
p = list(map(int, input().split()))
for d in range(x+1): #0に達した時点で0を出力して終了するので、大きい側は気にしなくてよい
    for d in [-1, 1]:
        a = x + i*s
        if not a in p:
            print(a)
            exit()

### FIXED CODE ###

x, n = map(int, input().split())
p = [int(i) for i in input().split()]
if n == 0:
    print(x)
else:
    under = over = x
    for num in range(x - min(p) + 2):
        if not (x - num in p):
            under = x - num
            break
    for num in range(max(p) - x + 2):
        if not (x + num in p):
            over = x + num
            break
    if x - under <= over - x:
        print(under)
    else:
        print(over)
kazu = int(input())
numbers_list = list(map(int, input().split()))
count = 0
seisu = 0
while True:
    for index in range(kazu):
        if numbers_list[index] % 2 != 0:
            seisu = 1
            break
        else:
            numbers_list[index] = numbers_list / 2
    if seisu == 1:
        break
    count += 1
print(count)


### FIXED CODE ###

kazu = int(input())
numbers_list = list(map(int, input().split()))
count = 0
seisu = 0
while True:
    for index in range(kazu):
        if numbers_list[index] % 2 != 0:
            seisu = 1
            break
        else:
            numbers_list[index] = numbers_list[index] / 2
    if seisu == 1:
        break
    count += 1
print(count)
import Math
A,B = list(map(float,input().split()))
print(Math.floor(A*(B*100)/100))

### FIXED CODE ###

import decimal
import math
A,B = input().split()
A = int(A)
B = decimal.Decimal(B)
print(math.floor(A*B))
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = h.sort()

if k >= n:
  print(0)
  
else:
  print(sum(h[:n-k]))

### FIXED CODE ###

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

if k >= n:
  print(0)
  
else:
  print(sum(h[:n-k]))
N, K = input().split()
p = list(map(int, input().sort().split()))
res = 0
for x in range(K):
  res += p[x]
print(res)

### FIXED CODE ###

from functools import reduce

N, K = [int(x) for x in input().split()]
p = sorted([int(x) for x in input().split()])
print(reduce(lambda x, y: x + y, p[0:K]))
import bisect
from collections import deque
import math

N, M = map(int, input().split())
_A = list(map(int, input().split()))
A = deque(sorted(_A, reverse=True))
#A  = sorted(_A, reverse=True)

for i in range(M):
    a = A.popleft()
    a /= 2
    index = bisect.bisect_left(A, a)
    A.insert(index-1, a)

ans = 0
for a in A:
    ans += math.floor(a)
print(int(ans))

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = [-a for a in A]
heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    a /= 2
    heapq.heappush(A, a)

ans = 0
for a in A:
    ans += - a//1
print(int(ans))
import math

N,X = (int(i) for i in input().split())
x = [int(i) for i in input().split()]
#d = [abs(X-i) for i in x if abs(X-i)!=0]
d = [abs(X-i) for i in x]

gcd = d[0]
i=1
while True:
    if i>=N:
        break
    gcd = math.gcd(gcd,d[i])
    i=i+1 

print(gcd)

### FIXED CODE ###

import fractions

N,X = (int(i) for i in input().split())
x = [int(i) for i in input().split()]
#d = [abs(X-i) for i in x if abs(X-i)!=0]
d = [abs(X-i) for i in x]

gcd = d[0]
i=1
while True:
    if i>=N:
        break
    gcd = fractions.gcd(gcd,d[i])
    i=i+1 

print(gcd)