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

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

maximized = [False] * N

for k in range(K):
    B = [0] * N

    # 全玉maxになったとき
    if all(maximized):
        break

    for i in range(N):
        # 強さはN超にはならない
        if A[i] == N:
            B[i] = A[i]
            maximized[i]= True
        else:
            # 照らせる範囲
            l = max(0, i - A[i])
            r = min(N - 1, i + A[i])

            for j in range(l, r + 1):
                B[j] += 1
    A = B

A = [str(a) for a in A]
print(' '.join(A))

### FIXED CODE ###

import numpy as np
from numba import njit

N, K = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
a = np.array(A, dtype=int)


fin = [N] * N

@njit(cache=True)
def calc_b(a):
    b = np.zeros(N, dtype=np.int64)
    for i, _a in enumerate(a):
        l = max(0, i - _a)
        r = min(N - 1, i + _a)

        # imos hou
        b[l] += 1
        if r + 1 < N:
            b[r + 1] -= 1

    b = np.cumsum(b)
    # print('b_sum', b)
    return b


for k in range(min(K,100)):
    # print('a', a)
    a = calc_b(a)
    # if all(a == fin):
    #     break

a = [str(_) for _ in a]
print(' '.join(a))
# print('step=', k)
### BUGGY CODE ###

N, M = map(int, input().split())
edges = [[] for _ in range(N)]

for _ in range(M):
    fr, to = map(int, input().split())
    fr -= 1
    to -= 1
    edges[fr].append(to)
    edges[to].append(fr)

def isBipartite():
    sign = [-1] * N
    st = [(0, 0)]
    while st:
        now, p = st.pop()
        sign[now] = p

        for to in edges[now]:
            if sign[to] == -1:
                st.append((to, (p + 1) % 2))
                continue
            if sign[to] != (p + 1) % 2:
                return -1

    return sum(sign)

s = isBipartite()

if s == -1:
    print(N * (N - 1) // 2 - M)
else:
    print(s * (N - s) - M)


### FIXED CODE ###

N, M = map(int, input().split())
edges = [[] for _ in range(N)]

for _ in range(M):
    fr, to = map(int, input().split())
    fr -= 1
    to -= 1
    edges[fr].append(to)
    edges[to].append(fr)

def isBipartite():
    sign = [-1] * N
    st = [(0, 0)]
    while st:
        now, p = st.pop()

        if sign[now] != -1 and sign[now] != p:
            return -1
        if sign[now] == p:
            continue
        sign[now] = p

        for to in edges[now]:
            st.append((to, (p + 1) % 2))

    return sum(sign)

s = isBipartite()

if s == -1:
    print(N * (N - 1) // 2 - M)
else:
    print(s * (N - s) - M)
### BUGGY CODE ###

n, m = map(int, input().split())
a = [[] for _ in range(n)]
b = []
for i in range(m):
    s, t = map(int, input().split())
    a[s-1].append(t)
    b.append((s, t))
for i in range(n):
    a[i].sort()

for i in range(m):
    s, t = b[i][0], b[i][1]
    u = str(a[s-1].index(t)+1)
    print("0"*(6-len(str(s))) + str(s) + "0"*(6-len(u)) + u)



### FIXED CODE ###

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

cities = [[] for _ in range(n)]

for i, (p, y) in enumerate(a):
    cities[p-1].append((y, i))

ans = [None]*m
for p in range(n):
    for j, (y, i) in enumerate(sorted(cities[p])):
        tmp = str(p+1).zfill(6) + str(j+1).zfill(6)
        ans[i] = tmp

print(*ans, sep="\n")
### BUGGY CODE ###

n = int(input())
a_ls = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a_ls[i]
if ans > 10**18:
    print(-1)
else:
    print(ans)
        


### FIXED CODE ###

import sys
n = int(input())
a_ls = list(map(int, input().split()))
ans = 1
if min(a_ls) != 0:
    for i in range(n):
        ans *= a_ls[i]
        if ans > 10**18:
            print(-1)
            sys.exit()
    if ans > 10**18:
        print(-1)
    else:
        print(ans)
else:
    print(0)
### BUGGY CODE ###

N,M=map(int,input().split());D=[9e9for _ in range(2**N)];D[0]=0
for i in range(M):
 a,_=input().split();s=sum(2**~-int(c)for c in input().split())
 for j in range(2**N):t=s|j;D[t]=min(D[t],D[j]+int(a))
print(-1*(D[-1]>8e9)or D[-1])

### FIXED CODE ###

N,M=map(int,input().split());D=[0]+[9**9]*(1<<N)
for i in range(M):
 a=int(input().split()[0]);s=sum(1<<~-int(c)for c in input().split())
 for j in range(1<<N):D[s|j]=min(D[s|j],D[j]+a)
print(D[-2]%(9**9)or-1)
### BUGGY CODE ###

N = int(input())
l = [-1 for i in range(N)]
for i in range(N):
  A = int(input())
  for j in range(N):
    if l[j] < A:
      l[j] = A
      break
###
for i in range(N):
  if l[i] == -1:
    ans = i
    break
  #出会わなかったパターンを忘れ気味
  if i == N-1:
    ans = N  
print(ans)    

### FIXED CODE ###

N = int(input())
l = [-1 for i in range(N)]
for i in range(N):
  A = int(input())
  ok = N-1
  ng = -1
  while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    if l[mid] < A:
      ok = mid
    else:
      ng = mid  
  l[ok] = A
###
for i in range(N):
  if l[i] == -1:
    ans = i
    break
  #出会わなかったパターンを忘れ気味
  if i == N-1:
    ans = N  
print(ans)
### BUGGY CODE ###

import copy
def resolve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    
    if K + min(A) >= N:
        print(" ".join(map(str, [N]*N)))
        return

    for i in range(K):
        A_next = [0] * len(A)
        for i, a in enumerate(A):
            A_next[i] += 1
            for d in range(1, a+1):
                idx = i - d
                if idx >= 0 and idx < len(A_next):
                    A_next[idx] += 1

                idx = i + d
                if idx >= 0 and idx < len(A_next):
                    A_next[idx] += 1
        A = copy.deepcopy(A_next)

        if min(A) == N:
            break 

    print(" ".join(map(str, A_next)))

if __name__ == "__main__":
    resolve()

### FIXED CODE ###

import copy
from functools import lru_cache
import numpy as np
from numba import njit

#@njit
# @njit('(i8[::1],)', cache=True)
# def func(A):
#     N = len(A)
#     B = np.zeros_like(A)
#     for i in range(N):
#         l = max(0, i - A[i])
#         r = min(i + A[i], N-1)
#         B[l] += 1
#         if r+1 < N:
#             B[r+1] -= 1

#     B = np.cumsum(B)
#     return B

def resolve():
    N, K = map(int, input().split())
    A = np.array(list(map(int, input().split())))

    # N = 2 * 10**5
    # K = 2 * 10**5
    # A = np.array([0] *  N)

    @njit
    def func(A):
        #N = len(A)
        B = np.zeros_like(A)
        for i in range(N):
            l = max(0, i - A[i])
            r = min(i + A[i], N-1)
            B[l] += 1
            if r+1 < N:
                B[r+1] -= 1

        B = np.cumsum(B)
        return B

    for k in range(K):
        #print(k)
        A = func(A)
        if k >= 50:
            break

    print(" ".join(map(str, A)))

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

INF = float('inf')

class MinSegTree:
    """
    0-indexed
    query : [L, R)
    """
    def __init__(self, size):
        self.size = 1 << (size.bit_length())  # 完全二分木にする
        self.data = [INF] * (2 * self.size - 1)

    def build(self, rawData):
        self.data[self.size - 1: self.size - 1 + len(rawData)] = rawData
        for i in range(self.size - 1)[:: -1]:
            self.data[i] = min(self.data[2 * i + 1], self.data[2 * i + 2])

    def update(self, index, value):
        index += self.size - 1
        self.data[index] = value
        while index >= 0:
            index = (index - 1) // 2
            self.data[index] = min(self.data[2 * index + 1], self.data[2 * index + 2])

    def query(self, left, right):
        L = left + self.size
        R = right + self.size
        ret = INF
        while L < R:
            if R & 1:
                R -= 1
                ret = min(ret, self.data[R - 1])
            if L & 1:
                ret = min(ret, self.data[L - 1])
                L += 1
            L >>= 1
            R >>= 1
        return ret

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

events = []
for i in range(N):
    S, T, X = map(int, input().split())
    events.append((S - X, True, i, X))
    events.append((T - X, False, i, X))
events.sort()

tree = MinSegTree(N)

D = [int(input()) for _ in range(Q)]
M = len(events)
now = 0
ans = []
for d in D:
    while now < M and events[now][0] <= d:
        _, isStart, i, x = events[now]
        if isStart:
            tree.update(i, x)
        else:
            tree.update(i, INF)
        now += 1
    ans.append(tree.data[0])

for a in ans:
    print(-1 if a == INF else a)


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

N, Q = map(int, input().split())
INF = float('inf')

events = []
for i in range(N):
    S, T, X = map(int, input().split())
    events.append((S - X, 0, X))
    events.append((T - X, 1, X))

for _ in range(Q):
    events.append((int(input()), 2, 0))

events.sort()

cnt = defaultdict(int)
cnt[INF] += 1
que = [INF]

for t, flag, x in events:
    if flag == 0:
        if cnt[x] == 0:
            heappush(que, x)
        cnt[x] += 1
    elif flag == 1:
        cnt[x] -= 1
    else:
        while cnt[que[0]] == 0:
            heappop(que)
        print(que[0] if que[0] != INF else -1)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
result = 1
checker =False
for j in a:
  if j > 1000000000000000000:
    result = -1
    checker =True
if 0 in a:
  result = 0
  checker=True
while checker==False:
  i = 0
  while i != len(a):
    result = result*a[i]
    i += 1
  checker = True
    

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
result = 1
for i in range(len(a)):
  result = result*a[i]
  if result == 0:
    break
  elif result > 1000000000000000000:
    break

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)
### BUGGY CODE ###

n =int(input())
s = input()
res = 10**6
for i in range(0,n+1):
    tres = s[:i].count("#") + s[i:].count(".")
    res = min(res,tres)

print(res)

### FIXED CODE ###

n =int(input())
s = input()
tres = s.count(".")
res = tres
for c in s:
    if c == ".":
        tres -= 1
    else:
        tres += 1
    res = min(res,tres)        

print(res)
### BUGGY CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort()
c = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if l[i] + l[j] <= l[k]:
                break    
            c += 1
print(c)

### FIXED CODE ###

import bisect

n = int(input())
l = list(map(int, input().split()))
l.sort()
c = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):   
        c += bisect.bisect_left(l, l[i] + l[j]) - j - 1
print(c)
### BUGGY CODE ###

def main():
    import sys
    sys.setrecursionlimit(1000000)

    N = int(input())
    A = [[]]
    for _ in range(N):
        A.append([0]+list(map(int,input().split())))

    #AR[i][j] => iにとって選手jとの試合が何番目か
    AR = [[]]
    for i in range(1,N+1):
        AR.append([0]*(N+1))
        for j in range(1,N):
            b = A[i][j]
            AR[i][b] = j

    edges = {}
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            edges[(i,j)] = []
            jForI = AR[i][j]
            if jForI < N-1:
                nxForI = A[i][jForI+1]
                edges[(i,j)].append((min(i,nxForI),max(i,nxForI)))
            iForJ = AR[j][i]
            if iForJ < N-1:
                nxForJ = A[j][iForJ+1]
                edges[(i,j)].append((min(j,nxForJ),max(j,nxForJ)))
    del A
    del AR

    steps = {}
    def dfs(i,j):
        #iとjの試合を1日目とし、試合終了まで何日かかるかを返す。
        if (i,j) not in steps:
            steps[(i,j)] = 0
            res = 1
            for a,b in edges[(i,j)]:
                res = max(res,dfs(a,b)+1)
            steps[(i,j)] = res
        elif steps[(i,j)] == 0:
            print(-1)
            exit()
        return steps[(i,j)]

    ans = 0
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            ans = max(ans,dfs(i,j))
    print(ans)
main()

### FIXED CODE ###

"""
最長経路問題として解く。

各試合のノードを作成。
各試合ノードごとに、「この試合が終わったら、次はこの試合ができるようになる。」という対応関係を作っていく。
"""
def main():
    import sys
    sys.setrecursionlimit(1000000)
    input = sys.stdin.readline

    N = int(input())

    A = [[0]*(N)]
    for i in range(N):
        A.append([0]+list(map(int,input().split())))
    
    #選手iにとって、選手jが何番目の相手かを逆引きするメモを用意しておく。
    reverseMemo = [[-1]*(N+1) for _ in range(N+1)]
    for i in range(1,N+1):
        for j in range(1,N):
            a = A[i][j]
            reverseMemo[i][a] = j
    edges = {}
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            match = (i,j)
            edges[match] = []
            if reverseMemo[i][j] != N-1:
                nx = A[i][reverseMemo[i][j]+1]
                edges[match].append((min(i,nx),max(i,nx)))
            if reverseMemo[j][i] != N-1:
                nx = A[j][reverseMemo[j][i]+1]
                edges[match].append((min(j,nx),max(j,nx)))
    
    del reverseMemo
    del A
    
    stepMemo = {}
    def dfs(i,j,path):
        #i,jの試合日を含めて、あと何日必要なのかを返す。
        if (i,j) not in stepMemo:
            if (i,j) in path:
                print(-1)
                exit()
            else:
                path.add((i,j))
            res = 1
            for a,b in edges[(i,j)]:
                res = max(res,dfs(a,b,path)+1)
            stepMemo[(i,j)] = res
        return stepMemo[(i,j)]

    ans = 0
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            if (i,j) not in stepMemo:
                ans = max(ans,dfs(i,j,set()))
    print(ans)
main()
### BUGGY CODE ###

def solve(S):
    T = []
    for i in range(len(S)):
        T.append(int(S[i:]) % 2019)
    T.append(0)

    ref = {}
    ret = 0
    for t in T:
        ret += ref.get(t, 0)
        ref[t] = ref.get(t, 0) + 1
    return ret

if __name__ == "__main__":
    S = input()
    print(solve(S))

### FIXED CODE ###

MOD = 2019

def solve(S):
    N = len(S)
    dp = [0 for _ in range(MOD)]
    tmp = 0
    ret = 0
    for i in range(N):
        m = (tmp + int(S[i]) * pow(10, N - i - 1, MOD)) % MOD
        ret += dp[m]
        dp[m] += 1
        tmp = m
    ret += dp[0]
    return ret

if __name__ == "__main__":
    S = input()
    print(solve(S))
### BUGGY CODE ###

def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))

N = i()
A = l()
num = sum(A)//2
A += A
ans = []
for i in range(N):
    num2 = 0
    for j in range(0,N,2):
        num2 += A[i+j]
    ans.append(abs((num-num2))*2)
print(*ans)

### FIXED CODE ###

def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))

N = i()
A = l()
num = sum(A)//2
A += A
ans = []
for i in range(1):
    num2 = 0
    for j in range(0,N,2):
        num2 += A[i+j]
    ans.append(abs((num-num2))*2)
    r = abs((num-num2))*2
for i in range(1,N):
    r = A[i-1]*2-r
    ans.append(r)
print(*ans)
### BUGGY CODE ###

def resolve():
    import numpy as np
    from scipy.sparse.csgraph import shortest_path
    from scipy.sparse import csr_matrix
    n, x, y = map(int, input().split())
    netw = [[0]*n for _ in range(n)]
    for i in range(n):
        for j in range(n):
            if abs(j-i) == 1:
                netw[i][j] = 1
    netw[x-1][y-1] = 1
    netw[y-1][x-1] = 1
    netw = np.array(netw)
    ans = {}
    a = shortest_path(netw)
    for i in range(n-1):
        for j in range(i+1, n):
            if a[i][j] in ans:
                ans[a[i][j]] += 1
            else:
                ans[a[i][j]] = 1
    for i in range(1, n):
        if i in ans:
            print(ans[i])
        else:
            ans[i] =0
            print(ans[i])
        
resolve()

### FIXED CODE ###

def resolve():
    n,x,y = map(int, input().split())
    ans = {}
    for i in range(1, n):
        for j in range(i+1, n+1):
            dist1 = j-i
            dist2 = abs(x-i)+1+abs(y-j)
            dist =min (dist1, dist2)
            if dist in ans:
                ans[dist] += 1
            else:
                ans[dist] = 1
    for i in range(1,n):
        if i not in ans:
            ans[i] =0
        print(ans[i])
resolve()
### BUGGY CODE ###

def gen(x):
    root = int(pow(x, 0.5))

    yield x

    for k in range(2, root):
        if x % k == 0:
            yield k
            yield x // k

    k = root
    if x % k == 0:
        yield k
        if k * k != x:
            yield x // k


def main():
    N = int(input())

    # N%K!=0
    cnt = len(tuple(gen(N - 1)))

    # N%K==0
    for k in gen(N):
        X = N
        while X % k == 0:
            X //= k
        cnt += (X % k == 1)

    print(cnt)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def gen(x):
    root = int(pow(x, 0.5))
    for k in range(1, root + 1):
        if x % k == 0:
            yield k
            if k != x // k:
                yield x // k


def main():
    N = int(input())

    # N%K!=0
    cnt = sum(1 for _ in filter(lambda x: x > 1, gen(N - 1)))

    # N%K==0
    for k in filter(lambda x: x > 1, gen(N)):
        x = N
        while x % k == 0:
            x //= k

        if x % k == 1:
            cnt += 1

    print(cnt)


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

# -*- coding: utf-8 -*-
import bisect

N, Q = map(int, input().split())
S = input()

ac_list = []
for i in range(N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        ac_list.append(i)

len_ac = len(ac_list)
for i in range(Q):
    l, r = map(int, input().split())
    left = l-1 if l-1 < len_ac else len_ac
    li_index = bisect.bisect_left(ac_list, l-1, 0, left)
    right = r-1 if r-1 < len_ac else len_ac
    ri_index = bisect.bisect_left(ac_list, r-1, 0, right)
    ans = len(ac_list[li_index:ri_index])
    print(ans)

### FIXED CODE ###

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

N, Q = map(int, input().split())
S = input()

t = [0] * (N+1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i: i + 2] == 'AC' else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
### BUGGY CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))

C = Counter(A)
if C[1] == 1:
    print(1)
    exit()
if C[1] >= 2:
    print(0)
    exit()

ans = 0
for a, v in C.items():
    if v >= 2:
        ans += v
        continue
    for i in range(2, int(a ** 0.5) + 1):
        if a % i == 0:
            if C[i] > 0:
                ans += 1
                break
            if C[a // i] > 0:
                ans += 1
                break

print(N-ans)

### FIXED CODE ###

from collections import Counter
U = 10 ** 6 + 1

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

C = Counter(A)
dp = [0] * U

ans = 0
for k in sorted(C.keys()):
    if dp[k]:
        continue
    if C[k] == 1:
        ans += 1
    for i in range(k, U, k):
        dp[i] = 1

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

N = int(input())

myans = 0

for i in range(N):
    myans += i
    
print(myans)

### FIXED CODE ###

N = int(input())

N = N -1

mysum = ((N*(N+1))//2)

print(mysum)
### BUGGY CODE ###

n,m=map(int,input().split())
ans=0

if n==1:
	ans=m
else:
	for i in range(1,m//n +1):
		if m%i == 0 and m/i >= n:
			ans = max(ans, i)
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
m_root=int(m**0.5)
div_l=[]
ans=0

for i in range(1,m_root + 1):
    if m%i == 0:
        div_l.append(i)
        div_l.append(m//i)

if m//n in div_l:
    ans = m//n
else:
    div_l.append(m//n)
    div_l.sort()
    ans = div_l[div_l.index(m//n) - 1]
print(ans)
### BUGGY CODE ###

N = int(input())
A = []

class Node:
    def __init__(self, data):
        self.data = data
        self.left = None
        self.right = None

class BST:
    def __init__(self, number_list):
        self.root = None
        self.ans = 1
        self.leftMin = 0
        self.leftestNode = None
        for node in number_list:
            self.insert(node)

    def insert(self, data):
        n = self.root #nにルートを代入
        if n == None: #ルートに何も入っていない場合
            self.root = Node(data) #ルートにノードを代入(二分探索木の一番上の部分が出来る)
            return #呼び出し部分に戻る
        else: #ルートノードに既に数値が入ってる場合
            while True: #return等が入るまでずっと実行
                entry = n.data #entryにnが持つデータ(数値)を入れる
                if data <= entry: # 左
                    if n.left is None: #nの左エッジに何も入っていない場合
                        n.left = Node(data) #nの左エッジにdata(代入するデータ)を代入
                        self.leftestNode = n.left
                        self.ans += 1
                        return ##呼び出し部分に戻る
                    if self.leftMin >= data :
                        self.leftMin = data
                        self.leftestNode.left = Node(data)
                        self.ans += 1
                        return
                    n = n.left #nの左に何か入っている場合nにnのleftを代入
                else: #entryとdata(代入するデータ)を比較してentryの方が小さい場合
                    if n.right is None: #nの右エッジに何も入っていない場合
                        n.right = Node(data) #nの右エッジにdata(代入するデータ)を代入
                        return #呼び出し部分に戻る
                    n.data = max(n.data, data)
                    return
    def getAns(self) :
        return self.ans


for _ in range(N) :
    a = int(input())
    A.append(a)

tree = BST(A)

print(tree.getAns())

### FIXED CODE ###

import bisect

N = int(input())
A = []

a = int(input())

val = [-a]
length = 1

for _ in range(N - 1) :
    a = int(input())
    a *= -1
    i = 0

    index = bisect.bisect_right(val, a)
    if index >= length :
        val.append(a)
        length += 1
    else :
        val[index] = a

print(length)
### BUGGY CODE ###

def solve():
    n=int(input())
    a=list(map(int,input().split()))
    ans=0
    for i in range(n-1):
        for j in range(i+1,n):
            ans+=a[i]^a[j]
            if ans>=10**9+7:
                ans=ans%(10**9+7)
    print(ans)
    

solve()

### FIXED CODE ###

import sys
input=sys.stdin.readline
n=int(input())
a=tuple(map(int,input().split()))
mod=10**9+7
cnt=[0]*60

for temp in a:
    if temp==0:continue
    digit=len(bin(temp))-2
    for j in range(digit):
        if (temp>>j)&1:
            cnt[j]=cnt[j]+1

#print(cnt)
ans=0
for i in range(60):
    if cnt[i]==0:continue
    ans=(ans+pow(2,i)*cnt[i]*(n-cnt[i]))%mod
print(ans%mod)
### BUGGY CODE ###

n = int(input())
li = list(int(input()) for i in range(n))

for i in range(n):
  li_copy = li.copy()
  del li_copy[i]
  print(max(li_copy))

### FIXED CODE ###

n = int(input())
li = list(int(input()) for i in range(n))

sorted_li = sorted(li)
a, b = sorted_li[-1], sorted_li[-2]

for i in li:
  if i == a:
    print(b)
  else:
    print(a)
### BUGGY CODE ###

n,k = map(int,input().split())
x = list(map(int,input().split()))
y = set(x)
s = []
for i in y:
    s.append(x.count(i))
s.sort()
ans = 0
for i in range(len(s)-k):
    ans += s[i]
print(ans)

### FIXED CODE ###

import collections as c
n,k = map(int,input().split())
x = list(map(int,input().split()))
y = c.Counter(x)
s = []
for i in y.items():
    s.append([i[1],i[0]])
s.sort()
ans = 0
for i in range(len(s)-k):
    ans += s[i][0]
print(ans)