Harryxun/stf_run huggingface dataset:
# N = int(input())
N, M = [int(i) for i in input().split()]
key = []
for i in range(M):
    a, b = [int(_) for _ in input().split()]
    cs = [int(_) for _ in input().split()]
    s = 0
    for c in cs:
        c -= 1
        s |= 1 << c
    key.append([s, a])

INF = 10**9
dp = [INF for i in range(N**2)]
dp[0] = 0
for i in range(N**2):
    for j in range(M):
        t = i | key[j][0]
        cost = key[j][1]
        dp[t] = min(dp[t], dp[i] + cost)
ans = dp[-1]
if ans == INF:
    print(-1)
else:
    print(ans)



### FIXED CODE ###

# N = int(input())
N, M = [int(i) for i in input().split()]
key = []
for i in range(M):
    a, b = [int(_) for _ in input().split()]
    cs = [int(_) for _ in input().split()]
    s = 0
    for c in cs:
        c -= 1
        s |= 1 << c
    key.append([s, a])

INF = 10**9
dp = [INF for i in range(2**N)]
dp[0] = 0
for i in range(2**N):
    for j in range(M):
        t = i | key[j][0]
        cost = key[j][1]
        dp[t] = min(dp[t], dp[i] + cost)
ans = dp[-1]
if ans == INF:
    print(-1)
else:
    print(ans)
# -*- coding: utf-8 -*-

abc=[chr(i) for i in range(97,123)]

N=int(input())

ans=""

L=0
for i in range(1,12):
    if N > 26**i:
        N-=26**i
    else:
        L=i
        break
#print(L,N)
for i in range(L,1,-1):
    if N < 26**(i-1):
        ans+="a"
    else:        
       for j in range(1,26):
           if 26**(i-1)*j <= N and 26**(i-1)*(j+1) > N:
               ans+=abc[j]
               N-=26**(i-1)*j
               break
#print(L,N)
ans+=abc[N-1]
print(ans)


### FIXED CODE ###

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

abc=[chr(i) for i in range(97,123)]

N=int(input())

#for n in range(1,100):
#N=n
ans=""

L=0
for i in range(1,12):
    if N >= 26**i:
        N-=26**i
    else:
        L=i
        break
#print(L,N)

if N==0:
    for i in range(L-1):
        ans+="z"
else:
    for i in range(L,1,-1):
        if N <= 26**(i-1):
            ans+="a"
        else:        
            for j in range(1,26):
                if 26**(i-1)*j < N and 26**(i-1)*(j+1) >= N:
                    ans+=abc[j]
                    N-=26**(i-1)*j
                    break
    ans+=abc[N-1]
print(ans)

"""
re=0
L=len(ans)
for i in range(L):
    ind=abc.index(ans[L-i-1])+1
    re+=ind*26**i

print(re)

if n!=re:
    print(n)
    break
"""
import numpy as np


N = int(input().strip())
alist = list(map(int,input().strip().split()))

alist = np.array(alist)
alistp = np.abs(alist)
maxind = np.where(alistp==alistp.max())[0][0]

if alist[maxind]>0:
	positive = True
else:
	positive = False

count = 0
process = []
for i in range(N):
	if alist[i]*alist[maxind]<0:
		alist[i] = alist[i]+alist[maxind]
		count = count+1
		process.append([maxind,i])

if positive==True:
	for i in range(N-1):
		alist[i+1] = alist[i+1]+alist[i]
		count = count+1
		process.append([i,i+1])
else:
	for i in range(N,0,-1):
		alist[i-1] = alist[i-1]+alist[i]
		count = count+1
		process.append([i,i-1])

print(count)
for i in range(count):
	processi = process[i]
	print(processi[0]+1,processi[1]+1)


### FIXED CODE ###

import numpy as np


N = int(input().strip())
alist = list(map(int,input().strip().split()))

alist = np.array(alist)
alistp = np.abs(alist)
maxind = np.where(alistp==alistp.max())[0][0]

if alist[maxind]>0:
	positive = True
else:
	positive = False

count = 0
process = []
for i in range(N):
	if alist[i]*alist[maxind]<0:
		alist[i] = alist[i]+alist[maxind]
		count = count+1
		process.append([maxind,i])

if positive==True:
	for i in range(N-1):
		alist[i+1] = alist[i+1]+alist[i]
		count = count+1
		process.append([i,i+1])
else:
	for i in range(N-1,0,-1):
		alist[i-1] = alist[i-1]+alist[i]
		count = count+1
		process.append([i,i-1])

print(count)
for i in range(count):
	processi = process[i]
	print(processi[0]+1,processi[1]+1)
H,W=map(int, input().split())
s=[list(input()) for _ in range(H)]
d=[[H*W for _ in range(W)] for _ in range(H)]
def dfs(h, w, c):
	if d[h][w] <= c:
		return
	d[h][w] = c
	for dh,dw in [(0, -1), (-1, 0), (0, 1), (1, 0)]:
		if h+dh >= 0 and w+dw >= 0 and h+dh < H and w+dw < W and s[h+dh][w+dw] == ".":
			dfs(h+dh, w+dw, c+1)
dfs(-1, 0, 0)
print(H*W-d[H-1][W-1]-sum(map(lambda x: x.count("#"), s)))


### FIXED CODE ###

INF=10*10
H,W=map(int, input().split())
s=[list(input()) for _ in range(H)]
wall=sum(map(lambda x: x.count("#"), s))
d=[[INF for _ in range(W)] for _ in range(H)]
def bfs(h, w, c):
	if d[h][w] <= c:
		return
	d[h][w] = c
	for dh,dw in [(0, -1), (-1, 0), (0, 1), (1, 0)]:
		if h+dh >= 0 and w+dw >= 0 and h+dh < H and w+dw < W and s[h+dh][w+dw] == ".":
			bfs(h+dh, w+dw, c+1)
bfs(0, 0, 1)
print(-1 if d[H-1][W-1] == INF else H*W - d[H-1][W-1] - wall)
import sys

stdin = sys.stdin

ni = lambda: int(ns())
ns = lambda: stdin.readline().rstrip()
na = lambda: list(map(int, stdin.readline().split()))

# code here
n, a, b = na()
mod = 1000000007

def c(n, r):
    nu = 1
    de = 1
    for i in range(r):
        # nCr の分子
        nu = nu * (n - i) % mod
        # nCr の分母
        de = de * (i + 1) % mod
    # フェルマーの小定理より
    return nu * pow(de, mod - 2, mod) % mod

print((pow(2, n, mod) - c(n, a) - c(n, b) - 1) % mod)


### FIXED CODE ###

def com(n, r, mod):
    num = 1
    den = 1
    for i in range(r):
        num = (num * (n-i)) % mod
        den = (den * (i+1)) % mod
    return num * pow(den, mod-2, mod)

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

mod = 10**9 + 7

sum = pow(2, N, mod) - 1
sum -= com(N, A, mod)
sum -= com(N, B, mod)

print(int(sum % mod))
from collections import Counter

def Replacing():

    Num = int(input())

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

    Sum = sum(value_A)
    Counter_value = Counter(value_A)

    NumB = int(input())

    for i in range(NumB):
        value_B = list(map(int,input().split()))

        Sum += (value_B[1] - value_B[0])*Counter_value(value_B[0])
        Counter_value[value_B[1]] += Counter_value[value_B[0]]
        Counter_value[value_B[0]] = 0

        print(Sum)

if __name__ == '__main__':
    Replacing()


### FIXED CODE ###

from collections import Counter

def Replacing():

    Num = int(input())

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

    Sum = sum(value_A)
    Counter_value = Counter(value_A)

    NumB = int(input())

    for i in range(NumB):
        value_B = list(map(int,input().split()))

        Sum += (value_B[1] - value_B[0])*Counter_value[value_B[0]]
        Counter_value[value_B[1]] += Counter_value[value_B[0]]
        Counter_value[value_B[0]] = 0

        print(Sum)

if __name__ == '__main__':
    Replacing()
l = map(int, raw_input().split())

a = 0
b = 0
for i in len(l):
  if l[i] == 5:
    a = a + 1
  elif l[i] == 7:
    b = b + 1

if (a==2 or b ==1):
  print("Yes")
else:
  print("No")
 

### FIXED CODE ###

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

a = 0
b = 0
for i in range(len(l)):
  if (l[i] == 5):
    a = a + 1
  elif (l[i]) == 7:
    b = b + 1
  else:
    pass

if (a==2 and b ==1):
  print("YES")
else:
  print("NO")
import itertools
N , M = (map(int , input().split()))
H = list(map(int , input().split()))
AB = [list(map(int, input().split())) for i in range(M)]
HH = {i+1 : H[i] for i in range(len(H))}
count = []
for i in AB:
    if HH[i[1]] > HH[i[0]]:
        count.append(i[1])
for i in HH:
    if i in CC:
        pass
    else:
        count.append(i)
print(len(list(set(count))))

### FIXED CODE ###

N , M = (map(int , input().split()))
H = list(map(int , input().split()))
AB = [list(map(int, input().split())) for i in range(M)]
HH = {i+1 : H[i] for i in range(len(H))}

count = {i+1 : 0 for i in range(N)}
for i in AB:
    if HH[i[1]] > HH[i[0]]:
        count[i[0]] -= 1
    elif HH[i[1]] == HH[i[0]]:
        count[i[0]] -= 1
        count[i[1]] -= 1
    else:
        count[i[1]] -= 1
        
print(sum([1 for i in count.values() if i == 0]))
import math
from decimal import *
import mpmath
a, b, h, m = map(int, input().split())

big = max(30*h, 6*m)
small = min(30*h, 6*m)
gap = min(big - small, 360 - (big - small)) + (m*0.5)


print(format(Decimal(a**2 + b**2 - 2*a*b*math.cos(mpmath.radians(gap)))**Decimal("0.5"), ".20f"))

### FIXED CODE ###

import math
a, b, h, m = map(int, input().split())

big = max(30*h + (m*0.5), 6*m)
small = min(30*h + (m*0.5), 6*m)
gap = min(big - small, 360 - (big - small))

print(format(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(gap))), ".20f"))
import sys
from collections import defaultdict as dd
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
N = int(input())
e = dd(list)
for _ in range(N - 1):
  u, v = map(int, input().split())
  e[u].append(v)
  e[v].append(u)

cl = [0] * (N + 1)
vis = set()
def dfs(x):
  global cl
  global vis
  vis.add(x)
  for y in e[x]:
    if y in vis: continue
    cl[y] = (cl[x] + 1) % 2

dfs(1)
bl = cl.count(1)
wh = N - bl

nm = [[] for _ in range(3)]
for i in range(1, N + 1): nm[i % 3].append(i)
#print(nm)

res = [0] * (N + 1)
for i in range(1, N + 1):
  if cl[i]:
    if len(nm[1]):
      res[i] = nm[1].pop()
    else:
      res[i] = nm[0].pop()
  else:
    if len(nm[2]):
      res[i] = nm[2].pop()
    else:
      res[i] = nm[0].pop()

print(*res[1: ])

### FIXED CODE ###

import sys
from collections import defaultdict as dd
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
N = int(input())
e = dd(list)
for _ in range(N - 1):
  u, v = map(int, input().split())
  e[u].append(v)
  e[v].append(u)

cl = [0] * (N + 1)
vis = set()
def dfs(x):
  global cl
  global vis
  vis.add(x)
  for y in e[x]:
    if y in vis: continue
    cl[y] = (cl[x] + 1) % 2
    dfs(y)

dfs(1)
bl = cl.count(1)
wh = N - bl
res = [0] * (N + 1)
nm = [[] for _ in range(3)]
for i in range(1, N + 1): nm[i % 3].append(i)
#print(cl)
if bl <= N // 3:
  for i in range(1, N + 1):
    if cl[i]:
      res[i] = nm[0].pop()
    else:
      if len(nm[1]): res[i] = nm[1].pop()
      elif len(nm[2]): res[i] = nm[2].pop()
      else: res[i] = nm[0].pop()
  print(*res[1: ])
  exit(0)
if wh <= N // 3:
  for i in range(1, N + 1):
    if cl[i] == 0:
      res[i] = nm[0].pop()
    else:
      if len(nm[1]): res[i] = nm[1].pop()
      elif len(nm[2]): res[i] = nm[2].pop()
      else: res[i] = nm[0].pop()
  print(*res[1: ])
  exit(0)
#print(nm)
#print(cl, nm)
f = 0
for i in range(1, N + 1):
  if cl[i]:
    if len(nm[1]):
      res[i] = nm[1].pop()
    else:
      res[i] = nm[0].pop()
  else:
    if len(nm[2]):
      res[i] = nm[2].pop()
    else:
      res[i] = nm[0].pop()

print(*res[1: ])
import collections
import numpy as np
n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
CountList = list(Col) 
for i in range(n-len(CountList)):
    CountList.append(0)
#padding = np.zeros_like(list(range(n-len(CountList))))
#print(padding)
#CountList2 = CountList + padding

for i in CountList:
    print(i)

#for i in range(n):
#    CountList[i] = List.count(i+1)


### FIXED CODE ###

import collections

n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
Col2 = sorted(Col.items())
CountList = [0]*n
for i in Col2:
    CountList[i[0]-1] = i[1]
#CountList = list(Col2.values()) 
#for i in range(n-len(CountList)):
#    CountList.append(0)

for i in CountList:
    print(i)
import numpy as np
S = input()
INF = 10**9+7
dp = np.array([0,0,0], dtype=np.int64)
N = 1
for i in range(len(S)):
  if S[i]=='A':
    dp[0] += N%INF
    dp[0] %= INF
  elif S[i]=='B':
    dp[1] += (dp[0]%INF)
  elif S[i]=='C':
    dp[2] += (dp[1]%INF)
  else:
    dp[1:] = dp[1:]*3+dp[:-1]
    dp[0] = dp[0]*3+N
    dp %= INF
    N *= 3
print(dp[2]%INF)

### FIXED CODE ###

S = input()
INF = 10**9+7
dp = [0,0,0]
N = 1
for i in range(len(S)):
  if S[i]=='A':
    dp[0] += N
    dp[0] %= INF
  elif S[i]=='B':
    dp[1] += dp[0]
    dp[1] %= INF
  elif S[i]=='C':
    dp[2] += dp[1]
    dp[2] %= INF
  else:
    a = dp[0]
    b = dp[1]
    dp[0] = N + dp[0]*3
    dp[1] = a + dp[1]*3
    dp[2] = b + dp[2]*3
    dp[0] %= INF
    dp[1] %= INF
    dp[2] %= INF
    N = (3*N)%INF
print(dp[2]%INF)
start = 0
end = len(N) - 1
result = True

while start < end: 
    if N[start] == N[end]: 
        start += 1
        end -= 1
    else:
        result = False
        break

return result

### FIXED CODE ###

N = str(input())
start = 0
end = len(N) - 1
result = True

while start < end: 
    if N[start] == N[end]: 
        start += 1
        end -= 1
    else:
        result = False
        break

if result:
	print("Yes")
else:
	print("No")
import numpy as np
from numba import jit

@njit
def solve():
    
    n = int(input())
    
    divisors = np.zeros(n+1, np.int64)
    
    for i in range(1, n+1):
        for j in range(i, n+1, i):
            divisors[j] += 1
    #print(divisors)
    
    ans = 0
    for k in range(n+1):
        ans += (k * divisors[k])
    
    print(ans)

solve()


### FIXED CODE ###

import numpy as np
from numba import jit

@jit
def solve():
    
    n = int(input())
    
    divisors = np.zeros(n+1, np.int64)
    
    for i in range(1, n+1):
        for j in range(i, n+1, i):
            divisors[j] += 1
    #print(divisors)
    
    ans = 0
    for k in range(n+1):
        ans += (k * divisors[k])
    
    print(ans)

solve()
import numpy as np

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

H = h * 30 + m*0.5
M = m * 6

if(H > M):
    deg = H - M
    rad = (deg*np.pi) / 180
    c = np.sqrt(a**2 + b**2 - 2*a*b*np.cos(rad))
    print(c)
elif(H < M):
    deg = M - H
    rad = (deg*np.pi) / 180
    c = np.sqrt(a**2 + b**2 - 2*a*b*np.cos(rad))
    print(c)
else:
    print(b-a)


### FIXED CODE ###

n = input()

if(n[-1] == '0' or n[-1] == '6' or n[-1] == '1' or n[-1] == '8'):
    print('pon')
elif(n[-1] == '3'):
    print('bon')
else:
    print('hon')
n,q=map(int,input().split())
s=input()
lr = [list(map(int, input().split())) for _ in range(q)]

ruisekiwa=[0]*(n+1)
for i in range(n):
    if s[i]=="A" and s[i+1]=="C":
        ruisekiwa[i+1]=ruisekiwa[i]+1
    else:
        ruisekiwa[i+1] = ruisekiwa[i]
for i in range(q):
    print(ruisekiwa[lr[i][1]-1]-ruisekiwa[lr[i][0]-1])


### FIXED CODE ###

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

ruisekiwa=[0]*n
for i in range(n-1):
    if s[i]=="A" and s[i+1]=="C":
        ruisekiwa[i+1]=ruisekiwa[i]+1
    else:
        ruisekiwa[i+1] = ruisekiwa[i]
for i in range(q):
    print(ruisekiwa[lr[i][1]-1]-ruisekiwa[lr[i][0]-1])
N = input()
H = list(map(int,input().split()))

c1 =0
c2 =0
for i in range(N-1):
  c2=0
  for j in range(i+1:N-2):
    if H[i] >= H[j]:
      c2+=1
  c1=c2
print(c1)

### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
 
c1 =0
c2 =0
for i in range(N-1):
  if H[i] >= H[i+1]:
    c1+=1
  else:
    if c1 > c2:
      c2=c1
    c1=0
if c1>c2:
  c2=c1
print(c2)
import sympy as sym

def fib(n):
    x = sym.symbols('x',nonnegative=True,integer=True) #変数xの宣言(非負の整数)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1)) #一般項の式
    result=Fib.subs(x,n) #xにnを代入
    result=result.evalf() #式を浮動小数点数として評価
    return int(result)

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

time_f=[]

for i,v in enumerate(a):
    if i == 0:
        # print (fib(a[i]))
        time_f = fib(a[i])
    else:
        # print((a[i]-a[i-1]-1))
        # print (fib(a[i]-a[i-1]-1))
        time_f *=fib(a[i]-a[i-1]-1)


print(time_f%1000000007)

### FIXED CODE ###

n,m = map(int,input().split())
a =  [int(input()) for i in range(m)]

dp =[0]*(n+1)

for i in a:
    dp[i] = -1

for i in [0,1]:
    if dp[i] == -1:
        dp[i] =0
    else:
        dp[i] =1

for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = 0
    else:
        if dp[i-1]==dp[i-2]==0:break
        dp[i] = (dp[i-2]+dp[i-1])

print(dp[-1]%1000000007)
n = int(input())
count = 0
 
for i in range(1,n+1):
  if len(int(i))%2 == 1:
    count += 1
 
print(count)

### FIXED CODE ###

n = int(input())
count = 0
 
for i in range(1,n+1):
  if len(str(i))%2 == 1:
    count += 1
 
print(count)
from collections import Counter
a = input()
c1 = Counter(a)
flag = False
for i,j in c1.items():
  if(len(set(j))==1:
     flag=True
  else:
     flag= False
if(flag):
     print('Yes')
else:
     print('No')

### FIXED CODE ###

size = int(input())
a = input()
if a[0:size//2] == a[size//2:]:
    print('Yes')
else:
    print('No')
a, b, c, d = map(int,inout().split())

if a-c >= d or (a-b >= d and b-c >= d):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

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

if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d):
  print("Yes")
else:
  print("No")
mod=10**9+7
N,M=map(int,input().split())
from collections import defaultdict
yaku=defaultdict(int)
now=M
for i in range(2,1+M):
    if now**0.5<i:
        yaku[now]+=1
        break
    while now%i==0:
        yaku[i]+=1
        now//=i
    if now==1:
        break
kaijo=[0]*(1+N)
kaijo[0]=1
for i in range(1,1+N):
    kaijo[i]=kaijo[i-1]*i%mod
gyaku=[0]*(1+N)
gyaku[N]=pow(kaijo[N],mod-2,mod)
for i in range(N,0,-1):
    gyaku[i-1]=gyaku[i]*i%mod
def calc(N,x):
    dp=defaultdict(list)
    dp[1].append([1])
    for i in range(1,x):
        for L in dp[i]:
            if L[-1]+i<=x:
                dp[i+L[-1]].append(L+[L[-1]])
            M=L.copy()
            M[-1]+=1
            dp[i+1].append(M)
    res=0
    for L in dp[x]:
        now=kaijo[N]*gyaku[N-len(L)]%mod
        cnt=defaultdict(int)
        for l in L:
            cnt[l]+=1
        for k,v in cnt.items():
            now=now*gyaku[v]%mod
        res=(res+now)%mod
    return res
ans=1
for k,v in yaku.items():
    ans=ans*calc(N,v)%mod
print(ans)

### FIXED CODE ###

mod=10**9+7
N,M=map(int,input().split())
from collections import defaultdict
yaku=defaultdict(int)
now=M
for i in range(2,1+M):
    if now**0.5<i:
        yaku[now]+=1
        break
    while now%i==0:
        yaku[i]+=1
        now//=i
    if now==1:
        break
kaijo=[0]*(1+N)
kaijo[0]=1
for i in range(1,1+N):
    kaijo[i]=kaijo[i-1]*i%mod
gyaku=[0]*(1+N)
gyaku[N]=pow(kaijo[N],mod-2,mod)
for i in range(N,0,-1):
    gyaku[i-1]=gyaku[i]*i%mod
def calc(N,x):
    dp=defaultdict(list)
    dp[1].append([1])
    for i in range(1,x):
        for L in dp[i]:
            if L[-1]+i<=x:
                dp[i+L[-1]].append(L+[L[-1]])
            M=L.copy()
            M[-1]+=1
            dp[i+1].append(M)
    res=0
    for L in dp[x]:
        if len(L)>N:
            continue
        now=kaijo[N]*gyaku[N-len(L)]%mod
        cnt=defaultdict(int)
        for l in L:
            cnt[l]+=1
        for k,v in cnt.items():
            now=now*gyaku[v]%mod
        res=(res+now)%mod
    return res
ans=1
for k,v in yaku.items():
    ans=ans*calc(N,v)%mod
print(ans)
n, m = map(int, input().split())
a = list(map(int, input().split()))
import pdb

n_use = dict(zip(range(1, 10), [2, 5, 5, 4, 5, 6, 3, 7, 6]))
dp = ['']*(n+1)
for a_i in a:
    dp[n_use[a_i]] = str(a_i)
for i in range(1, n+1):
    for a_j in a:
        path_cur = '0' if dp[i] == '' else dp[i]
        i_prev = i - n_use[a_j]
        if i_prev < 0:
            continue
        else:
            path_prev = dp[i_prev]
            if len(path_prev) == 0:
                continue
            path_new = str(a_j)+path_prev
            dp[i] = str(max(int(path_cur), int(path_new)))
            
# print(dp)
print(dp[-1])


### FIXED CODE ###

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

n_use = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [0]+[-float('inf')]*n

for i in range(1, n+1):
    for a_j in a:
        i_prev = i - n_use[a_j]
        if i_prev < 0:
            continue
        else:
            dp[i] = max(dp[i], dp[i_prev]*10+a_j)
# print(dp)
print(dp[-1])
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))

for i in range(n):
	h[i] = abs(a-(t - h[i]*0.006))

print(h.index(min(h))+1)

### FIXED CODE ###

x,y = map(int, input().split())
print(int(x+y/2))
n, k = map(int, input().split())
lst = list(map(int, input().split())
print(sum(sorted(lst)[:k])

### FIXED CODE ###

n, k = map(int, input().split())
lst = list(map(int, input().split()))
print(sum(sorted(lst)[::-1][:k]))
import math

def binaryinsertion(A,x):
    left=0;right=len(A)-1
    while(True):
        center = math.floor((low + high) / 2)
        if(right == left):
            if(x[0]<A[left][0]):
                A.insert(left,x)
                break
            else :
                A.insert(left + 1,x)
                break
        else:
            if(x[0] < A[centre][0]) :
                right = centre - 1
            elif(A[centre][0] < x[0]) :
                left = centre + 1
            else : 
                A.insert(centre,x)
                break

[N,L] = [int(x) for x in input().split()]
A = [[int(x),int(i)] for i,x in enumerate(input().split())]
sweep = A[:L]
sweep = sorted(sweep)
ans = [str(sweep[0][0])]
for i in range(L,N) :
    sweep.remove(A[i-L])
    binaryinsertion(sweep,A[i])
    ans.append(str(sweep[0][0]))
print(" ".join(ans))

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
from collections import defaultdict
import itertools
import math

def dfs(vum,s,visit,depth):
    # print('first')
    # print(s,depth,visit)
    if visit[s-1] >= 0:
        return visit
    visit[s-1] = depth
    # print(vum[s])
    for u in vum[s]:
        # print('now', str(u))
        if visit[u-1] >= 0:
            # print('skip', str(u))
            if visit[u-1] > depth:
                visit[u-1] = depth
                # print('update', str(u))
            continue
        s = u
        depth += 1
        visit = dfs(vum,s,visit,depth)
    return visit


def main():
    N,M = [int(x) for x in input().split()]
    vum = defaultdict(list)
    for i in range(M):
        a,b = [int(x) for x in input().split()]
        vum[a].append(b)
        vum[b].append(a)
        
    s = 1 # 現在地 (初期値はゴールを設定)
    visit = [-1]*len(vum) # 訪問リスト
    depth = 0 # 移動数(深さ)
    visit = dfs(vum,s,visit,depth)
    if -1 in visit:
        print('No')
    else:
        print('Yes')
    for v in visit[1:]:
        print(v)

if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import defaultdict
import queue

def main():
    N,M = [int(x) for x in input().split()]
    vum = defaultdict(list)
    for i in range(M):
        a,b = [int(x) for x in input().split()]
        vum[a].append(b)
        vum[b].append(a)
        
    ### bfs ###
    q = queue.Queue()
    F = [-1]*N # 道標の先の部屋
    s = 1 # 始点
    step = 0
    while True:
        # print('s',str(s))
        for v in vum[s]:
            # print('v',str(v))
            if F[v-1] < 0:
                q.put(v)
                F[v-1] = s
        if q.empty():
            break
        # print(list(q.queue),V)
        s = q.get()

    if -1 in F[1:]:
        print('No')
    else:
        print('Yes')
        for d in F[1:]:
            print(d)

if __name__ == '__main__':
    main()