Harryxun/stf_run huggingface dataset:
x1 = int(input())
x2 = input()

R_i = [i for i, x in enumerate(x2) if x == "R"]
G_i = [i for i, x in enumerate(x2) if x == "G"]
B_i = [i for i, x in enumerate(x2) if x == "B"]

R = len(R_i)
G = len(G_i)
B = len(B_i)

xs = map(sorted, product(R_i, G_i))

s = 0
for a in xs:
    k = a[1]*2 - a[0]  # 2j-i
    if k in B_i:
        s +=1
    i = a[0]*2 - a[1]  # 2j-k
    if i in B_i:
        s +=1
    j = (a[0] + a[1]) / 2
    if j.is_integer():
        j = int(j)
        if j in B_i:
            s +=1
print(R*G*B - s)

### FIXED CODE ###

from itertools import product

x1 = int(input())
x2 = input()

R_i = [i for i, x in enumerate(x2) if x == "R"]
G_i = [i for i, x in enumerate(x2) if x == "G"]
B_i = {i for i, x in enumerate(x2) if x == "B"}

R = len(R_i)
G = len(G_i)
B = len(B_i)

xs = map(sorted, product(R_i, G_i))

s = 0
for a in xs:
    k = a[1]*2 - a[0]  # 2j-i
    if k in B_i:
        s +=1
    i = a[0]*2 - a[1]  # 2j-k
    if i in B_i:
        s +=1
    j = (a[0] + a[1]) / 2
    if j.is_integer():
        j = int(j)
        if j in B_i:
            s +=1
print(R*G*B - s)
n,m=map(int,input().split())
a=m//2
if n>a:
    print(a)
else:
    print((n+a)//2)


### FIXED CODE ###

mod=10**9+7
n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%mod
print(ans)
K,N = map(int,input().split())
A = list(map(int,input().split()

X = A[1] - A[0]
i = 1
while i < N-1:
    Y = A[i+1] - A[i]
    if X < Y:
        X = Y
    i += 1
Z = A[0] + K - A[N-1]
if X < Z:
    X = Z

print(K - X)

### FIXED CODE ###

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

X = A[1] - A[0]
i = 1
while i < N-1:
    Y = A[i+1] - A[i]
    if X < Y:
        X = Y
    i += 1
Z = A[0] + K - A[N-1]
if X < Z:
    X = Z

print(K - X)
str = input()
ans = []
allow = ["A","C","G","T"]
ans_str = ""
for index in range(len(str)):
  if str[index] in allow:
    ans_str = ans_str + str[index]
  else:
    ans.append(ans_str)
    ans_str = ""
    continue
 
print(len(sorted(ans, key=len)[-1]))

### FIXED CODE ###

str = input()
ans = []
allow = ["A","C","G","T"]
count = 0
for s in str:
  if s in allow:
    count = count + 1
    ans.append(count)
  else:
    count = 0
    
if len(ans) == 0:
  print(0)
else:
  print(sorted(ans)[-1])
a,b,c = map(int,Input.split())

if a * c <= b:
    print(c)
elif a > b:
    print(0)
elif a * c >b:
    print(a)

### FIXED CODE ###

a,b,c = map(int,input().split())
print(min(b//a,c))
n=int(input())
a=input()
b=a[len(a)-1]
word1=[a]
word2=[b]
c=0

for i in range(n-1):
    aa=input()
    bb=aa[0]
    if aa not in word1 and word2[i]==bb:
        word1.append(aa)
        top=aa[len(aa)-1]
        word2.append(top)
    else:
        c=1
        
print("Yes" if c==0 else "No")

### FIXED CODE ###

n=int(input())
a=input()
b=a[len(a)-1]
word1=[a]
word2=[b]
c=0

for i in range(n-1):
    aa=input()
    bb=aa[0]
    if aa not in word1 and word2[i]==bb:
        word1.append(aa)
        top=aa[len(aa)-1]
        word2.append(top)
    else:
        c=1
        break
        
print("Yes" if c==0 else "No")
S = list(input())
N = len(S)

c=0
i=0
f=0
while(1):
    if S[i] != S[i+1]:
        del S[i:i+2]
        c+=2
        N-=2
        if i>=1:
            i-=2
        else:
            i-=1
    i+=1
    #print(i,N,S,f)                                                                      
    if i+1 == N:
        break
print(c)

### FIXED CODE ###

S = list(input())
N = len(S)

c=0
i=0
f=0
while(1):
    if i+1 == N or N < 2:
        break
    if S[i] != S[i+1]:
        del S[i:i+2]
        c += 2
        N -= 2
        if i >= 1:
            i -= 2
        else:
            i -= 1
    i += 1
    #print(i,N,S,f)                                                                      
print(c)
N = int(input())
A = list(map(int, input().split()))

Cost = lambda a, Sum:0 if (Sum > 0) ^ (Sum + a > 0) else abs(Sum + a) + 1
Sum = lambda a, preSum:preSum+a if (Sum > 0) ^ (preSum + a > 0) else -preSum//abs(preSum)

pSum = Sum(A[0],0)
nSum = Sum(A[0],0)
pCost = 0
nCost = 0
for a in A[1:]:
    pCost += Cost(a, pSum)
    pSum = Sum(a, pSum)
    nCost += Cost(a, nSum)
    nSum = Sum(a, nSum)
print(min(pCost, nCost))


### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]

def odd_positive(List):
    sum_a = 0
    cost = 0
    i = 0
    for a in List:
        i += 1
        sum_a += a
        if i & 1 and sum_a <= 0:
            cost += - sum_a + 1
            sum_a = 1
        elif (not i & 1) and sum_a >= 0:
            cost += sum_a + 1
            sum_a = -1
    return cost


def odd_negative(List):
    sum_a = 0
    cost = 0
    i = 0
    for a in List:
        i += 1
        sum_a += a
        if i & 1 and sum_a >= 0:
            cost += sum_a + 1
            sum_a = -1
        elif (not i & 1) and sum_a <= 0:
            cost += - sum_a + 1
            sum_a = 1
    return cost
    
ans = min(odd_positive(a), odd_negative(a)) 
print(ans)
A,P=map(int(input().split())
print((3*A+P)//2)


### FIXED CODE ###

A,P=map(int,input().split())
print((3*A+P)//2)
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i%10!=0 ])
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
print(sum+df-10)

### FIXED CODE ###

import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i % 10 != 0 ],default=0)
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
if(df == 0):
        print(sum)
else:
        print(sum-df)
n,m,*t=map(int,open(0).read().split())
a=sorted(t[:n])[::-1]
m=0
for c,b in sorted(zip(t[n+1::2],t[n::2]))[::-1]:
 while a*b and c>a[-1]:m+=c;b-=1;a.pop()
print(m+sum(a))

### FIXED CODE ###

n,m,*t=map(int,open(0).read().split())
a=sorted(t[:n])[::-1]
m=0
for c,b in sorted(zip(t[n+1::2],t[n::2]))[::-1]:
 while a and b and c>a[-1]:m+=c;b-=1;a.pop()
print(m+sum(a))
m=input()
def s(x):
  if x=='1'
  	return '9'
  else:
    return '1'
print(s(m[0])+s(m[1])+s(m[2])

### FIXED CODE ###

m=input()
def s(x):
  if x=='1':
    return '9'
  else:
    return '1'
print(s(m[0])+s(m[1])+s(m[2]))
from math import factorial as f
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7


def p(n, r):
    return f(n) // f(n-r)


def c(n, r):
    return p(n, r) // f(r)


for i in range(1, blue + 1):
    space = c(red + 1, i)
    pattern = c(blue - 1, blue - i)
    print(space * pattern % mod)


### FIXED CODE ###

from math import factorial as f
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7


def p(n, r):
    return f(n) // f(n-r)


def c(n, r):
    return p(n, r) // f(r)


for i in range(1, blue + 1):
    if red < i - 1:
        print(0)
    else:
        space = c(red + 1, i)
        pattern = c(blue - 1, blue - i)
        print(space * pattern % mod)
n, d = map(int, input().split())

A = []

for i in range(n):
  A_i = list(map(int, input().split()))
  A.append(A_i)
  
ans = 0

for j in A:
  if A[0] ** 2 + A[1] ** 2 <= d **2 :
    ans += 1

print(ans)

### FIXED CODE ###

n, d = map(int, input().split())

A = []

for i in range(n):
  A_i = list(map(int, input().split()))
  A.append(A_i)
  
ans = 0

for j in A:
  if (j[0] ** 2 + j[1] ** 2) <= d **2 :
    ans += 1

print(ans)
N=[int(x) for x in input().split()]
if not N[2]%N[1]==0:
   c=N[2]//N[1]+1
else:
    c=N[2]//N[1]
if not N[0]%N[3]==0:
   c=N[0]//N[3]+1

   d=N[0]//N[3]+1
else:
    d=N[0]//N[3]
if d>c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N=[int(x) for x in input().split()]
if N[0]>N[1]:
    print("safe")
else:
   print("unsafe")
s = input()

print({}{}{}).format(s[0],len(s)-2,s[-1])

### FIXED CODE ###

s = input()

a = s[0]
b = str(len(s) -2)
c = s[-1]

ans = [a,b,c]
res = "".join(ans)
print(res)
import sys,queue,math,numpy as np,scipy as sc
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda : [int(x) for x in input().split()]
_LI = lambda : [int(x)-1 for x in input().split()]

N,M = LI()
B = [_LI() for _ in range(M)]

g = [i for i in range(N)]
c = [1 for _ in range(N)]

def root(x):
    if x != g[x]: g[x] = root(g[x])
    return g[x]

def union(x,y):
    rx = root(x)
    ry = root(y)
    if rx != ry:
        g[ry] = rx
        c[rx] += c[ry]
        c[ry] = 0

k = []



ans = []
B.reverse()
for a,b in B:
    ra = root(a)
    rb = root(b)
    if ra == rb:
        ans.append(0)
    else:
        ans.append(c[ra]*c[rb])
        union(ra,rb)

ans.reverse()
x = 0
for a in ans:
    x += a
    print (x)

### FIXED CODE ###

import sys,queue,math
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda : [int(x) for x in input().split()]
_LI = lambda : [int(x)-1 for x in input().split()]

N,M = LI()
B = [_LI() for _ in range(M)]

g = [i for i in range(N)]
c = [1 for _ in range(N)]

def root(x):
    if x != g[x]: g[x] = root(g[x])
    return g[x]

def union(x,y):
    rx = root(x)
    ry = root(y)
    if rx != ry:
        if c[ry] > c[rx]: ry,rx = rx,ry
        g[ry] = rx
        c[rx] += c[ry]
        c[ry] = 0

ans = []
B.reverse()
for a,b in B:
    ra = root(a)
    rb = root(b)
    if ra == rb:
        ans.append(0)
    else:
        ans.append(c[ra]*c[rb])
        union(ra,rb)

ans.reverse()
x = 0
for a in ans:
    x += a
    print (x)
nm = input()
n = int(nm[0])
m = int(nm[1])

ans = 0

n1 = n*(n-1)/2

n2 = m*(m-1)/2

ans = n1 + n2

print(ans)

### FIXED CODE ###

nm = input().split()
n = int(nm[0])
m = int(nm[1])

ans = 0

n1 = n*(n-1)/2

n2 = m*(m-1)/2

ans = int(n1 + n2)

print(ans)
import sys
sys.setrecursionlimit = 2 * 10 ** 5

n, q = map(int, input().split())

connect = [set() for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    connect[a-1].add(b-1)
    connect[b-1].add(a-1)

counter = [0] * n
for _ in range(q):
    p, x = map(int, input().split())
    counter[p-1] += x

ans = [0] * n
def dfs(me, parent, cum):
    cum += counter[me]
    ans[me] = cum
    for child in connect[me]:
        if child != parent:
            dfs(child, me, cum)

dfs(0, -1, 0)

print(*ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n, q = map(int, input().split())

connect = [set() for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    connect[a-1].add(b-1)
    connect[b-1].add(a-1)

counter = [0] * n
for _ in range(q):
    p, x = map(int, input().split())
    counter[p-1] += x

ans = [0] * n
def dfs(me, parent, cum):
    cum += counter[me]
    ans[me] = cum
    for child in connect[me]:
        if child != parent:
            dfs(child, me, cum)

dfs(0, -1, 0)

print(*ans)
def myAnswer(N:int,A:list) -> int:
   if(N == 1): return 1
   dic ={}
   for a in A:
      if(a == 0):
         for i in range(2):
            if(i in dic.keys()):
               dic[i]+=1
            else:
               dic[i]=1
      else:
         for i in range(a-1,a+2):
            if(i in dic.keys()):
               dic[i]+=1
            else:
               dic[i] = 1
   return max(list(dic.values()))

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ =

### FIXED CODE ###

def myAnswer(N:int,A:list) -> int:
   if(N == 1): return 1
   dic ={}
   for a in A:
      if(a == 0):
         for i in range(2):
            if(i in dic.keys()):
               dic[i]+=1
            else:
               dic[i]=1
      else:
         for i in range(a-1,a+2):
            if(i in dic.keys()):
               dic[i]+=1
            else:
               dic[i] = 1
   return max(list(dic.values()))

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ == '__main__':
   main()
n, k = map(int, input().split())
s = input().rstrip()
ans = 1
left = 0
right = -1
pos = s.find('10', 0)
if pos == -1:
  i = n
else
  i = pos + 1

while i < n:
    if k > 0:
        pos = s.find('01', i)
        if pos == -1:
            i = n
            right = n - 1
        else:
            pos = s.find('10', pos + 1)
            if pos == -1:
                i = n
                right = n - 1
            else:
                right = pos
                i = pos + 1
        k = k - 1
        ans = max(ans, right - left + 1)
    else:
        pos = s.find('01', left)
        left = pos + 1
        k = k + 1

print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
s = input().rstrip()


#n, k = 5, 3
#s = "00010"

m = 0
cur_s = cur_e = 0

while True:
  while cur_e < n and s[cur_e] == '1':
    cur_e+=1
  
  if k <= 0 or cur_e >= n:
    wm = cur_e - cur_s
    if wm > m:
      m = wm
      
    if cur_e >= n:
      break
 
    while cur_s < n and s[cur_s] == '1':
      cur_s+=1
    while cur_s < n and s[cur_s] == '0':
      cur_s+=1
    k+=1

  if k > 0:
    while cur_e < n and s[cur_e] == '0':
      cur_e+=1
    k-=1
    
print(m)
N = int(input())
import sys
sys.setrecursionlimit(10000)

graph = [[] for _ in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    graph[a-1].append((b-1, c))
    graph[b-1].append((a-1, c))

color = [-1 for _ in range(N)]
def dfs(p, c, color):
    color[p] = c
    cinv = 0 if c == 1 else 1
    for q, d in graph[p]:
        if color[q] != -1:
            continue
        if d % 2 == 1:
            color = dfs(q, cinv, color)
        else:
            color = dfs(q, c, color)
    return color

A = dfs(0, 0, color)
for a in A:
    print(a)

### FIXED CODE ###

N = int(input())
import sys
sys.setrecursionlimit(90000)

graph = [[] for _ in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    graph[a-1].append((b-1, c))
    graph[b-1].append((a-1, c))

color = [-1 for _ in range(N)]
def dfs(p, c, color):
    color[p] = c
    cinv = 0 if c == 1 else 1
    for q, d in graph[p]:
        if color[q] != -1:
            continue
        if d % 2 == 1:
            color = dfs(q, cinv, color)
        else:
            color = dfs(q, c, color)
    return color

A = dfs(0, 0, color)
for a in A:
    print(a)
def check(a,b,c,d):
	while(a>0 and c>0):
		c-=b
		if(c==0):
			return 1
		a-=d
		if(a==0):
			return 0
	if(a<0):
		return 0
	if(c < 0):
		return 1
inp1=list(map(int,input().strip().split()))[:4]
a,b,c,d=inp1[0],inp1[1],inp1[2],inp1[3]
if(check(a,b,c,d)):
	print("Yes")
else:
	print("No")

### FIXED CODE ###

inp1=list(map(int,input().strip().split()))[:2]
s,w=inp1[0],inp1[1]
if(w >= s):
	print("unsafe")
else:
	print("safe")
INF = 10 ** 20

def minimum_cost(now, visited):
  if (now, visited) in dp:
    return dp[(now, visited)]
  if visited == end:
    return 0
  
  ret = INF
  for to in range(1, n + 1):
    if to not in visited:
      ret = min(ret, minimum_cost(to, tuple(sorted(list(visited) + [to]))) + cost(to, visited))
  dp[(now, visited)] = ret
  return ret

def cost(to, visited):
  return min(tlst[to - 1][i] for i in visited)

while True:
  n = int(input())
  if n == 0:
    break
  tlst = [list(map(int, input().split())) for _ in range(n)]
  dp = {}
  end = tuple(i for i in range(n + 1))
  ans = INF
  for i in range(1, n + 1):
    ans = min(ans, minimum_cost(i, (0, i)) + tlst[i - 1][0])
  print(ans)


### FIXED CODE ###

INF = 10 ** 20

def minimum_cost(rest, dp, tlst, tord, end, n):
  if rest in dp:
    return dp[rest]
  if rest == end:
    return 0
  
  ret = INF
  for ind, to in enumerate(rest):
    if to == "0":
      tmp = minimum_cost(rest[:ind] + "1" + rest[ind + 1:], dp, tlst, tord, end, n) + cost(ind, rest, tlst, tord, n)
      if tmp < ret:
        ret = tmp
  dp[rest] = ret
  return ret

def cost(ind, rest, tlst, tord, n):
  order = tord[ind - 1]
  for i in order:
    if rest[i] == "1":
      return tlst[ind - 1][i]


def main():
  while True:
    n = int(input())
    if n == 0:
      break
    tlst = [list(map(int, input().split())) for _ in range(n)]
    tord = []
    for lst in tlst:
      tmp = sorted(zip(lst, range(n + 1)))
      tord.append([i for _, i in tmp])
    dp = {}
    end = "1" * (n + 1)
    ans = minimum_cost("1" + "0" * n, dp, tlst, tord, end, n)
    print(ans)

main()
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
y = []
for i in range(1,m):
  y.append(x[i] - x[i-1])
y.sort()
print(sum(y[:max(0,m-n)]))

### FIXED CODE ###

a,b = map(int,input().split())
print(a/b)
n = int(input())
p = list(map(int,input().split()))
p.sort()


ans = p[int(n/2)] - [int(n/2)-1]
print(ans)

### FIXED CODE ###

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

ans = p[int(n/2)] - p[int(n/2)-1]
print(ans)
a,b = map(int, input())
print(max(a,b)*2-1)

### FIXED CODE ###


a, b = map(int, input().split())
 
if a > b:
    print(a+a-1)
elif a < b:
    print(b+b-1)
else:
    print(a+b)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
def list_euclid(int_list):
    ans = int_list[0]
    for i in range(1,len(int_list)):
        ans = euclid(ans, int_list[i])
        if ans == 1:
            return ans
    return ans
n = int(input())
a = list(map(int, input().split()))
a.sort()
max = 0
b_int = 0
min = 1
if n < 5:
    for i in range(0,n):
        if b_int == a[0]:
            p = a.pop(0)
            a.append(p)
        else:
            p = a.pop(0)
            b_int = p
            x = list_euclid(a)
        if max < x:
            max = x
            a.append(p)
else:
    for i in range(0,n):
        if b_int == a[0]:
            p = a.pop(0)
            # a.append(p)
        else:
            if max == 0:
                p = a.pop(0)
                b_int = p
                k = len(a) // 2
                x = 0
                y = list_euclid(a[0:k])
                if y == 1:
                    x = 1
                else:
                    z = list_euclid(a[k:len(a)])
                    x = euclid(y, z)
                if max < x:
                    max = x
                a.append(p)
                min = p
            elif min <= max:
                break
            else:
                p = a.pop(0)
                b_int = p
                k = len(a) // 2
                x = 0
                y = list_euclid(a[0:k])
                if y == 1:
                    x = 1
                else:
                    z = list_euclid(a[k:len(a)])
                    x = euclid(y, z)
                if max < x:
                    max = x
                a.append(p)
print(max)



### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
def gcd(a, b): #最大公約数
  while b:
    a, b = b, a % b
  return int(a)
    
n = int(input())
a = list(map(int, input().split()))
if n==2:
  print(max(a))
  sys.exit(0)
elif n==3:
  lis = [gcd(a[0], a[1]), gcd(a[1], a[2]), gcd(a[2], a[0])]
  print(max(lis))
  sys.exit(0)
tmp_unused = gcd(a[0], a[1])
tmp_used = max(a[0], a[1])
#print("used=", tmp_used, "unused=", tmp_unused)
for i in range(2,n):
  #print(a[i])
  tmp_used = max(tmp_unused, gcd(tmp_used, a[i]))
  tmp_unused = gcd(tmp_unused, a[i])
  
  #print("used=", tmp_used, "unused=", tmp_unused)
print(tmp_used)
a,b,c=map(int,raw_input().split())
max_num=a
if max_num < b
    max_num=b
if max_num < c
    max_num=c
print max_num*9+(a+b+c)

### FIXED CODE ###

A,B,C = map(int,raw_input().split())
max_num=A
if max_num < B:
    max_num = B
if max_num < C:
    max_num= C
print max_num*9+(A+B+C)
x = input()
print(x//500 * 1000 + x%500//5 * 5)

### FIXED CODE ###

x = int(input())
print(x//500 * 1000 + x%500//5 * 5)
n, q = map(int, input().split())
s = input()
t = [None] * q
d = [None] * q
for i in range(q):
    t[i], d[i] = input().split()
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c < 0:
            l = m
            break
    else:
        r = m
a = l
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c >= n:
            r = m
            break
    else:
        l = m
b = n - l
print(max(0, n - a - b))


### FIXED CODE ###

A, B, C = map(int, input().split())
if A == B == C:
    print('Yes')
else:
    print('No')
A, B = (int(i) for i in input().split())
1 <= B <= A <= 20
 
if B % A == 0：
    print(A+B)
else:
    print(A-B)

### FIXED CODE ###

A, B = map(int, input().split())
 
if B % A == 0:
    print(A + B)
else:
    print(B - A)
n = int(input())
l = list(map(int, input().split()))

c_idx = n / 2 - 1
l.sort()
print(l[c_idx + 1] - l[c_idx])

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
 
c_idx = n // 2 - 1
l.sort()
print(l[c_idx + 1] - l[c_idx])
n = int(input())
a = [int(input()) for _ in range(n)]

sum_a = sum(a)

if sum_a % 10 == 0:
	can_nums = filter(lambda x: x%10 != 0, set(a))
	if len(list(can_nums)) == 0:
		print(0)
	else:
		print(sum_a - min(can_nums))
else:
	print(sum_a)

### FIXED CODE ###

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

sum_a = sum(a)

if sum_a % 10 == 0:
	can_nums = filter(lambda x: x%10 != 0, set(a))
	if len(list(can_nums)) == 0:
		print(0)
	else:
		print(sum_a - min(can_nums))
else:
	print(sum_a)
import sys

sys.setrecursionlimit(10000)

class Node():
    def __init__(self, p, l, r):
        self.p = p
        self.l = l
        self.r = r


def rec(u, p):
    D[u] = p
    if T[u].r != -1:
        rec(T[u].r, p)
    if T[u].l != -1:
        rec(T[u].l, p + 1)


N = int(input())
T = [Node(-1, -1, -1) for _ in range(N)]
D = [-1] * N
for i in range(N):
    i, k, *cs = map(int, input().split())
    for j, c in enumerate(cs):
        if j == 0:
            T[i].l = c
        else:
            T[l].r = c
        l = c
        T[c].p = i
for i, t in enumerate(T):
    if t.p == -1:
        r = i
rec(r, 0)
for i, t in enumerate(T):
    cs = []
    c = t.l
    while c != -1:
        cs.append(c)
        c = T[c].r
    if t.p == -1:
        print('node {}: parent = {}, depth = {}, root, {}'
              .format(i, t.p, D[i], cs))
    elif t.l == -1:
        print('node {}: parent = {}, depth = {}, leaf, {}'
              .format(i, t.p, D[i], cs))
    else:
        print('node {}: parent = {}, depth = {}, internal node, {}'
              .format(i, t.p, D[i], cs))



### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

class Node():
    def __init__(self, p, l, r):
        self.p = p
        self.l = l
        self.r = r


def rec(u, p):
    D[u] = p
    if T[u].r != -1:
        rec(T[u].r, p)
    if T[u].l != -1:
        rec(T[u].l, p + 1)


N = int(input())
T = [Node(-1, -1, -1) for _ in range(N)]
D = [-1] * N
for i in range(N):
    i, k, *cs = map(int, input().split())
    for j, c in enumerate(cs):
        if j == 0:
            T[i].l = c
        else:
            T[l].r = c
        l = c
        T[c].p = i
for i, t in enumerate(T):
    if t.p == -1:
        r = i
rec(r, 0)
for i, t in enumerate(T):
    cs = []
    c = t.l
    while c != -1:
        cs.append(c)
        c = T[c].r
    if t.p == -1:
        print('node {}: parent = {}, depth = {}, root, {}'
              .format(i, t.p, D[i], cs))
    elif t.l == -1:
        print('node {}: parent = {}, depth = {}, leaf, {}'
              .format(i, t.p, D[i], cs))
    else:
        print('node {}: parent = {}, depth = {}, internal node, {}'
              .format(i, t.p, D[i], cs))
# 再帰制限に引っかかった場合に外す
import sys
sys.setrecursionlimit(100000)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

a = cmb(n,r)


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

for i in range(1,k+1):
    print(( cmb(n-k+1,i) * cmb(k-1,i-1) ) % (10**9+7))


### FIXED 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

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

for i in range(1,k+1):
    if n - k + 1 >= i:
        print(( cmb(n-k+1,i) * cmb(k-1,i-1) ) % (10**9+7))
    #青を分けようとするけど赤玉の隙間がたらないとき
    else:
        print(0)