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

from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()
P = LI()

X = list(itertools.combinations(P,K))

ans = 10**9
for x in X:
   ans = min(ans, sum(x))


print(ans)

### FIXED CODE ###

from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()
P = LI()

P = sorted(P)

ans = sum(P[:K])

print(ans)
### BUGGY CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 3*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

N, K = map(int, input().split())
MOD = 10**9+7
ans = 0
for i in range(N-K,N+1):
  m = cmb(N,i,MOD)%MOD
  m *= cmb(N-1,i-1, MOD)%MOD
  m %= MOD
  ans += m
  ans %= MOD
print(ans)

### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

N, K = map(int, input().split())
MOD = 10**9+7
n = min(N,K)
ans = 0
for i in range(max(1,N-n),N+1):
  m = cmb(N,i,MOD)
  m *= cmb(N-1,i-1, MOD)
  ans += m
  ans %= MOD
print(ans)
### BUGGY CODE ###

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

def burger(n):
    if n == 0:
        return 'P'
    ans = 'B' + burger(n-1) + 'P' + burger(n-1) + 'B'
    return ans

eat = burger(N)[ : X]
print(eat.count('P'))

### FIXED CODE ###

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

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(N, X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X-2-a[N-1])

print(f(N, X))
### BUGGY CODE ###

s = input()
q = int(input())
t  ={}
for i in range(q):
    t[i]=input().split()
rv_count = 0
x = "X"
for d in t.values():
    if d[0] == "1":
        x2 = x[::-1]
        rv_count += 1
    elif d[0] == "2":
        if d[1] == "1":
            x2 = d[2]+x
        else:
            x2 = x+d[2]
    x = x2
if rv_count%2 == 0:
    xf =x.replace("X", s)
else:
     xf =x.replace("X", s[::-1])
print(xf)

### FIXED CODE ###

s = input()
q = int(input())
t  ={}
for i in range(q):
    t[i]=input().split()
rv_count = 0
x = "X"
for d in t.values():
	if d[0] == "1":
		rv_count += 1
	else:
		if rv_count % 2 ==0:
			if d[1] == "1":
				x2 = d[2]+x
			else:
				x2 = x+d[2]
			x = x2
		else:
			red = d[2][::-1]
			if d[1] == "1":
				x2 = x + red
			else:
				x2 = red+x
			x = x2

if rv_count%2 == 0:
    xf = x.replace("X", s)
else:
	xf = x.replace("X", s)[::-1]
    
print(xf)
### BUGGY CODE ###

# D - Pairs

import numpy as np

N, K = map(int, input().split())
A = np.array(sorted(list(map(int, input().split()))), np.int64)

n_zero = len(A[A == 0])

def n_pairs_less_than_or_equal_to_border(product_border):
    n_pairs = -np.sum(A*A <= product_border) # i==jかつ条件を満たすペアの個数を先に引き、以降重複を許して数える
    n_pairs += n_zero * N * (product_border >= 0)

    for i in range(N):
        if A[i] > 0:
            n_pairs += np.searchsorted(A, product_border//A[i], side="right")
        elif A[i] < 0:
            n_pairs += N - np.searchsorted(A, -(-product_border//A[i]), side="left")

    n_pairs //= 2
    return n_pairs


lower = -(10**18)
upper = 10**18

while lower <= upper:
    x = (lower + upper) // 2
    if n_pairs_less_than_or_equal_to_border(x) >= K:
        ans = x
        upper = x - 1
    else:
        lower = x + 1

print(ans)

### FIXED CODE ###

# D - Pairs

import numpy as np

N, K = map(int, input().split())
A = np.array(sorted(list(map(int, input().split()))), np.int64)

n_zero = len(A[A == 0])
A_posi = A[A > 0]
A_nega = A[A < 0]

def n_pairs_less_than_or_equal_to_border(product_border):
    n_pairs = -np.sum(A*A <= product_border) # i==jかつ条件を満たすペアの個数を先に引き、以降重複を許して数える
    n_pairs += n_zero * N * (product_border >= 0)

    n_pairs += np.searchsorted(A, product_border//A_posi, side="right").sum()
    n_pairs += (N - np.searchsorted(A, -(-product_border//A_nega), side="left")).sum()

    # 上記2行は下記と同様の処理だが下記の実装だとTLE
    # for i in range(N):
    #     if A[i] > 0:
    #         n_pairs += np.searchsorted(A, product_border//A[i], side="right")
    #     elif A[i] < 0:
    #         n_pairs += N - np.searchsorted(A, -(-product_border//A[i]), side="left")

    n_pairs //= 2
    return n_pairs


lower = -(10**18)
upper = 10**18

while lower <= upper:
    x = (lower + upper) // 2
    if n_pairs_less_than_or_equal_to_border(x) >= K:
        ans = x
        upper = x - 1
    else:
        lower = x + 1

print(ans)
### BUGGY CODE ###

#ライブラリインポート
from collections import defaultdict
import queue

#入力受け取り
def getlist():
	return list(map(int, input().split()))

INF = float("inf")

class Graph(object):
    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, a, b):
        self.graph[a].append(b)

    def get_nodes(self):
        return self.graph.keys()

class BFS(object):
	def __init__(self, graph, s, N):
		self.g = graph.graph
		self.Q = queue.Queue()
		self.Q.put(s)
		self.pre = [None] * N
		while not self.Q.empty():
			v = self.Q.get()
			for i in self.g[v]:
				self.pre[i] = v
				self.Q.put(i)

#処理内容
def main():
	N, M = getlist()
	D = defaultdict(int)
	G = Graph()
	for i in range(N - 1 + M):
		A, B = getlist()
		G.add_edge(A - 1, B - 1)
		D[B - 1] += 1
	s = 0
	for i in range(N):
		if D[i] == 0:
			s = i
			break

	BF = BFS(G, s, N)
	ans = BF.pre
	for i in ans:
		if i == None:
			print(0)
		else:
			print(i + 1)

if __name__ == '__main__':
	main()

### FIXED CODE ###

from collections import defaultdict, deque

#入力受け取り
def getlist():
	return list(map(int, input().split()))

N, M = getlist()
outE = defaultdict(list)
inE = defaultdict(int)

for i in range(N + M - 1):
	u, v = getlist()
	outE[u - 1].append(v - 1)
	inE[v - 1] += 1

Q = deque()
for i in range(N):
	if inE[i] == 0:
		Q.append(i)
top = []
while Q:
	v1 = Q.popleft()
	top.append(v1)
	for v2 in outE[v1]:
		inE[v2] -= 1
		if inE[v2] == 0:
			Q.append(v2)

parent = [0] * N
for i in top:
	for j in outE[i]:
		parent[j] = i + 1
for i in range(N):
	print(parent[i])
### BUGGY CODE ###

def main():
  import fractions
  import math

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

  if a>b:
    a,b = b,a
  
  d = [1]
  num = 2

  while num <= min(a,b):
    if a%num == 0 and b%num == 0:
      d.append(num)
      while a%num == 0:
        a = a//num
      while b%num == 0:
        b = b//num
    num+=1
  
  print(len(d))

if __name__ == "__main__":
  main()

### FIXED CODE ###

def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()
### BUGGY CODE ###

import sys
def input(): return sys.stdin.readline().strip()

n=int(input())
xs=input()
#xk=list(map(int,list(xs)))
xj=xs.count("1")

x=int(xs,2)

for i in range(n-1,-1,-1):
    xi=x^(1<<i)
    pxi=xj
    if xs[n-1-i]=="0":
        pxi=pxi+1
    else:
        pxi=pxi-1
    if xi==0:
        print(0)
    else:
        xi=xi%pxi
        if xi==0:
            print(1)
        else:
            icnt=1
            while xi>0:
                icnt+=1
                xi=xi%(bin(xi).count("1"))
            print(icnt)

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()

n=int(input())
xs=input()
xj=xs.count("1")

x=int(xs,2)
xip=x%(xj+1)
if xj!=1:
    xim=x%(xj-1)

for i in range(n-1,-1,-1):
    if xs[n-1-i]=="0":
        pxi=xj+1
        i2=pow(2,i,pxi)
        xi=(xip+i2)%pxi
    elif xj==1:
        print(0)
        continue
    else:
        pxi=xj-1
        i2=pow(2,i,pxi)
        xi=(xim-i2)%pxi
    xi=xi%pxi
    if xi==0:
        print(1)
        continue
    icnt=1
    while xi>0:
#        print("i",i,"xi",xi,"icnt",icnt)
        icnt+=1
        xi=xi%(bin(xi).count("1"))
    print(icnt)
### BUGGY CODE ###

class Box:
  def __init__(self, line):
    self.__b = {}
    for i in map(int, line.split(' ')):
      if i not in self.__b:
        self.__b[i] = 1
      else:
        self.__b[i] += 1

  def convert(self, b, c):
    if b in self.__b:
      if c in self.__b:
        self.__b[c] += self.__b[b]
      else:
        self.__b[c] = self.__b[b]

      self.__b[b] = 0

  def sum(self):
    ret = 0
    for k, v in self.__b.items():
      ret += k * v
    return ret

if __name__ == "__main__":
  n = int(input())
  b = Box(input())
  q = int(input())
  for i in range(q):
    b.convert(*list(map(int, input().split(' '))))
    print(b.sum())

### FIXED CODE ###

class Box:
  def __init__(self, line):
    self.__b = {}
    for i in map(int, line.split(' ')):
      if i not in self.__b:
        self.__b[i] = 1
      else:
        self.__b[i] += 1

    self.__sum = 0
    for k, v in self.__b.items():
      self.__sum += k * v    

  def convert(self, b, c):
    if b in self.__b:
      if c in self.__b:
        self.__b[c] += self.__b[b]
      else:
        self.__b[c] = self.__b[b]

      self.__sum += (c - b) * self.__b[b]

      self.__b[b] = 0

  def sum(self):
    return self.__sum

if __name__ == "__main__":
  n = int(input())
  b = Box(input())
  q = int(input())
  for i in range(q):
    b.convert(*list(map(int, input().split(' '))))
    print(b.sum())
### BUGGY CODE ###

_,C,*I=[[*map(int,t.split())]for t in open(0)]
for d,q in I[731:]:
 I[d+364][0]=q;i,R,P,*L=[0]*29
 while i<365:t=I[i+365][0]-1;P+=sum(C)+(~i+L[t])*C[t];R+=I[i][t]-P;i+=1;L[t]=i
 print(R)

### FIXED CODE ###

def P(s):
  L = [0] * 26
  R = P = 0
  for i in range(D):
    t = I[i + D][0] - 1
    R += I[i][t]
    P += s - (i + 1 - L[t]) * C[t]
    R -= P
    L[t] = i + 1
  return R
(D,), C, *I = [list(map(int, o.split())) for o in open(0)]
for d, q in I[2*D + 1:]:
  I[d - 1 + D][0] = q
  print(P(sum(C)))
### BUGGY CODE ###

N, P = map(int,input().split())
n, p = N, P

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()

num = {}
s = 0
e = 0
i = 2
while s == 0:
  while p%i == 0:
    p = int(p/i)
    e += 1
    if(p == 1):
      s = 1
  if(e > 0):
    num[i] = e
  i += 1
  e = 0
cnt = 1
for k, v in num.items():
  if(v >= n):
    cnt *= k ** (v//n)
print(cnt)

### FIXED CODE ###

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

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
A.sort()
B.sort()
C.sort()
for i in range(N, 0, -1):
    for j in range(N, 0, -1):
        #print(B[j-1],C[i-1],"BC")
        if B[j-1] < C[i-1]:
            for k in range(N, 0, -1):
                #print(A[k-1],B[j-1],"AB")
                if A[k-1] < B[j-1]:
                    ans = ans + k
                    break
else:
    print(ans)


### FIXED CODE ###

n = int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))
count = 0

A.insert(0,-1)
A.append(10e+10)
C.insert(0,-1)
C.append(10e+10)

for bi in B:
    left = 0
    right = n+1
    
    while right-left>1:
        middle = (left+right) //2
        if A[middle]>=bi:
            right = middle
        else:
            left = middle
    a_count = left

    left = 0
    right = n+1
    while right-left>1:
        middle = (left+right) //2
        if C[middle]>bi:
            right = middle
        else:
            left = middle
    c_count = n+1-right

    count += a_count*c_count

print(count)
### BUGGY CODE ###

NQ = list(map(int, input().split()))
word = input()
word_list = list(word)
for i in range(0, NQ[1]):
    rl = list(map(int, input().split()))
    word = word_list[rl[0]-1:rl[1]]
    word = ''.join(word)
    print(word.count('AC'))

### FIXED CODE ###

n,q = map(int, input().split())
s = input()
count = [0]*n
for i in range(1,n):
    count[i] += count[i-1]
    if s[i-1:i+1]=="AC": count[i]+=1
for i in range(q):
    l,r = map(int, input().split())
    print(count[r-1]-count[l-1])
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N,M = map(int,input().split())
PY = [[int(i) for i in input().split()]for i in range(M)]
l = [[] for i in range(N+1)]
for p,y in PY:
    l[p].append(y)
for i in range(N+1):
    l[i].sort()
for p,y in PY:
    print(str(p).zfill(6),end="")
    print(str(l[p].index(y)+1).zfill(6))

### FIXED CODE ###

import heapq
N,M = map(int,input().split())
ans = [[0,0]for i in range(M)]
cityes = [[]for i in range(N)]
for i in range(M):
    p,y = map(int,input().split())
    heapq.heappush(cityes[p-1],[y,i])
for i in range(N):
    j = 0
    while cityes[i] != []:
        j += 1
        y,n = heapq.heappop(cityes[i])
        ans[n] = [i+1,j]
for a,b in ans:
    out = str(1000000+a)[1:] + str(1000000+b)[1:]
    print(out)
### BUGGY CODE ###

s=input().rstrip()
ans=[0 for i in range(2019)]
tmp=0
a=0
rs=reversed(s)
for i in rs:
    ans[tmp%2019]+=1
    tmp=tmp+int(i)*10**a
    a+=1
ans[tmp%2019]+=1
count=0
for i in ans:
    count+=int(i*(i-1)/2)
print(count)

### FIXED CODE ###

s=input().rstrip()
ans=[0 for i in range(2019)]
tmp=0
a=1
rs=reversed(s)
for i in rs:
    ans[tmp%2019]+=1
    tmp=(tmp+int(i)*a)%2019
    a*=10
    a%=2019
ans[tmp%2019]+=1
count=0
for i in ans:
    count+=int(i*(i-1)/2)
print(count)
### BUGGY CODE ###

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

A = sorted(A)

import bisect
idx0 = bisect.bisect_left(A, 0)
idx1 = bisect.bisect_left(A, 0)

A_nega = A[:idx0]
A_zero = A[idx0:idx1]
A_posi = A[idx1:]

#print(A_nega)
#print(A_zero)
#print(A_posi)

len_nega = len(A_nega)
len_zero = len(A_zero)
len_posi = len(A_posi)

target_area = ''
ans = 0

if len_nega * len_posi >= K:
  target_area = 'np'
elif len_nega * len_posi + len_zero >= K:
  target_area = 'z'
else:
  target_area = 'nn_pp'

#print(target_area)

if target_area == 'np':
  np_multiply = []
  for i in A_nega:
    for j in A_posi:
      np_multiply.append(i*j)

  np_multiply = sorted(np_multiply)
  ans = np_multiply[K-1]

elif target_area == 'z':
  ans = 0

elif target_area == 'nn_pp':
  nnpp_multiply = []
  for i in range(len_nega):
    for j in range(i+1, len_nega):
      nnpp_multiply.append(A_nega[i]*A_nega[j])
  for i in range(len_posi):
    for j in range(i+1, len_posi):
      nnpp_multiply.append(A_posi[i]*A_posi[j])

  nnpp_multiply = sorted(nnpp_multiply)

  K_rest = K - (len_nega * len_posi + len_zero)
  ans = nnpp_multiply[K_rest - 1]

print(ans)

### FIXED CODE ###

def abc155_d():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()

    from bisect import bisect_left, bisect_right
    lower = -10**18
    upper = 10**18
    while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for i in range(n-1):
            a = A[i]
            if a < 0:
                idx = bisect_left(A, (x+a+1)//a)
                cnt += n - max(idx, i+1)
            elif a > 0:
                idx = bisect_right(A, x//a)
                cnt += max(0, idx - i - 1)
            else:  # a == 0
                if x >= 0:
                    cnt += n - i - 1
            if cnt >= k: break
        if cnt >= k: upper = x
        else: lower = x
    print(upper)

if __name__ == '__main__':
    abc155_d()
### BUGGY CODE ###

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

L = int(a[0])
R = int(a[1])

for i in range(L, R + 1):
    for j in range(i + 1, R + 1 ):
        b = i * j % 2019
        c = min(b, c)
        
print(c)

### FIXED CODE ###

L, R = list(map(int, input().split()))
b = 0
ans = 10000

if R - L >= 2019:
    ans = 0
else:
    for i in range(L, R + 1):
        if i % 2019 == 0:
            ans = 0
        else:
            for j in range(i + 1, R + 1 ):
                if j % 2019 == 0:
                    ans = 0
                else:
                    b = i * j % 2019
                    ans = min(b, ans)   
print(ans)
### BUGGY CODE ###

n=int(input())
arr=list(map(int,input().split()))
dp=[[0]*n for _ in range(n)]
for i in range(n):
  if n%2==0:
    dp[i][i]=-arr[i]
  else:
    dp[i][i]=arr[i]
for i in range(1,n):
  for j in range(n-i):
    if (n-i)%2==0:
      dp[j][j+i]=min(dp[j][j+i-1]-arr[j+i],dp[j+1][j+i]-arr[j])
    else:
      dp[j][j+i]=max(dp[j][j+i-1]+arr[j+i],dp[j+1][j+i]+arr[j])
print(dp[0][n-1])

### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
dp=[[0]*n for _ in range(n)]
for i in range(n):
  if n%2==0:
    dp[i][i]=-arr[i]
  else:
    dp[i][i]=arr[i]
for i in range(1,n):
  for j in range(n-i):
    if (n-i)%2==0:
      dp[j][j+i]=min(dp[j][j+i-1]-arr[j+i],dp[j+1][j+i]-arr[j])
    else:
      dp[j][j+i]=max(dp[j][j+i-1]+arr[j+i],dp[j+1][j+i]+arr[j])
print(dp[0][n-1])
### BUGGY CODE ###


def resolve():
  N = int(input())
  X = input()
  base_1_count = X.count("1")

  for i in range(N):
    tar_X = list(X)
    first_1_count = base_1_count
    if tar_X[i] == "1":
      first_1_count -= 1
      tar_X[i] = "0"
    else:
      first_1_count += 1
      tar_X[i] = "1"
    target_int = int(''.join(tar_X), 2)
    count = 0
    num_of_1 = first_1_count
    while target_int != 0:
      target_int = target_int % num_of_1
      num_of_1 = bin(target_int).count("1")
      count += 1
    print(count)

if __name__ == "__main__":
  resolve()


### FIXED CODE ###

def resolve():
  N = int(input())
  X = input()

  if N == 1:
    if X.count("1"):
      print(0)
    else:
      print(1)
    return True

  base_1_count = X.count("1")
  if base_1_count == 0:
    for _ in range(N):
      print(1)
    return True

  X_int = int(X, 2)
  X_int_p = X_int%(base_1_count + 1)

  # RE 対策
  if base_1_count == 1:
    for i in range(N):
      if X[i] == "1":
        print(0)
      else:
        if i == N - 1:
          Xi = X_int_p + 1
        else:
          Xi = X_int_p
        count = 1
        while Xi != 0:
          Xi %= bin(Xi).count("1")
          count += 1
        print(count)
    return True

  X_int_m = X_int%(base_1_count - 1)
  for i in range(N):
    # 初期値計算を高速にやる
    if X[i] == "1":
      temp_1_count = base_1_count-1
      pow_2 = pow(2, N-i-1, base_1_count-1)
      if X_int_m <= pow_2:
        Xi = X_int_m - pow_2 + base_1_count-1
      else:
        Xi = X_int_m - pow_2
    else:
      temp_1_count = base_1_count+1
      Xi = X_int_p + pow(2, N-i-1, base_1_count+1)
      while Xi >= base_1_count+1:
        Xi %= base_1_count+1

    # print("1_c={0}".format(temp_1_count))
    if temp_1_count == Xi:
      print(1)
      continue

    count = 1
    while Xi != 0:
      num_of_1 = bin(Xi).count("1")
      Xi %= num_of_1
      count += 1
    print(count)

if __name__ == "__main__":
    resolve()
### BUGGY CODE ###

N = int(input())
Word_list = []
ans = 0
for i in range(N):
    Gift = input()
    CHECK = "Nothing"
    for i in Word_list:
        if i == Gift:
            CHECK = "Exist"
            break
    if CHECK == "Nothing":
        Word_list.append(Gift)
        ans += 1
# print(Word_list)
print(ans)


### FIXED CODE ###

N = int(input())
Word_list = []
ans = 0

for i in range(N):
    Gift = input()
    Word_list.append(Gift)
Word_list.sort()

Before_Word = ""

for i in range(N):
    if Word_list[i] != Before_Word:
        ans += 1
        Before_Word = Word_list[i]

print(ans)

#
# for i in range(N):
#     Gift = input()
#     CHECK = "Nothing"
#     for i in Word_list:
#         if i == Gift:
#             CHECK = "Exist"
#             break
#     if CHECK == "Nothing":
#         Word_list.append(Gift)
#         ans += 1
# # print(Word_list)
# print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
h, w = map(int, input().split())

s = [input() for i in range(h)]
l = [[0 for j in range(w)] for i in range(h)]
r = [[0 for j in range(w)] for i in range(h)]
u = [[0 for j in range(w)] for i in range(h)]
d = [[0 for j in range(w)] for i in range(h)]

for i in range(h):
    for j in range(w):
        l[i][j] = 0 if s[i][j] == '#' else 1 + (0 if j == 0 else l[i][j - 1])
    for j in range(w - 1, -1, -1):
        r[i][j] = 0 if s[i][j] == '#' else 1 + (0 if j == w - 1 else r[i][j + 1])

for j in range(w):
    for i in range(h):
        u[i][j] = 0 if s[i][j] == '#' else 1 + (0 if i == 0 else u[i - 1][j])
    for i in range(h - 1, -1, -1):
        d[i][j] = 0 if s[i][j] == '#' else 1 + (0 if i == h - 1 else d[i + 1][j])

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3)
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
h, w = map(int, input().split())

s = [input() for i in range(h)]
l = [[0 for j in range(w)] for i in range(h)]
r = [[0 for j in range(w)] for i in range(h)]
u = [[0 for j in range(w)] for i in range(h)]
d = [[0 for j in range(w)] for i in range(h)]

for i in range(h):
    for j in range(w):
        l[i][j] = 0 if s[i][j] == '#' else 1 + (0 if j == 0 else l[i][j - 1])
    for j in range(w - 1, -1, -1):
        r[i][j] = 0 if s[i][j] == '#' else 1 + (0 if j == w - 1 else r[i][j + 1])

for j in range(w):
    for i in range(h):
        u[i][j] = 0 if s[i][j] == '#' else 1 + (0 if i == 0 else u[i - 1][j])
    for i in range(h - 1, -1, -1):
        d[i][j] = 0 if s[i][j] == '#' else 1 + (0 if i == h - 1 else d[i + 1][j])

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3)
print(ans)
### BUGGY CODE ###

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

### FIXED CODE ###

n,m = map(int, input().split())
a = list(map(lambda x:int(x)*(-1), input().split()))
import heapq
heapq.heapify(a)
for _ in range(m):
    num = heapq.heappop(a)
    heapq.heappush(a,(-num//2)*(-1))
print(-sum(a))