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

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

cumsum = [0] * N
cumsum[0] = a[0]
for i in range(1, N):
    cumsum[i] = cumsum[i-1] + a[i]

dp = [[0] * N for _ in range(N)]

for j in range(1, N):
    for i in range(N-1):
        if i + j >= N:
            break
        minimum = float('inf')
        for k in range(j):
            #print('i:',i,' j:',j,' k:',k,' i+k:',i+k,' j-k:',j-k)
            temp = dp[i][k] + dp[i+k+1][j-k-1]
            if minimum > temp:
                minimum = temp
        dp[i][j] = minimum + (cumsum[i+j] - cumsum[i-1] if i > 0 else cumsum[i+j])

print(dp[0][N-1])

### FIXED CODE ###

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

cumsum = [0] * N
cumsum[0] = a[0]
for i in range(1, N):
    cumsum[i] = cumsum[i-1] + a[i]

dp = [[0] * N for _ in range(N)]

for j in range(1, N):
    for i in range(N-1):
        if i + j >= N:
            break
        minimum = float('inf')
        for k in range(j):
            #print('i:',i,' j:',j,' k:',k,' i+k:',i+k,' j-k:',j-k)
            temp = dp[i][k] + dp[i+k+1][j-k-1]
            if minimum > temp:
                minimum = temp
        dp[i][j] = minimum + (cumsum[i+j] - cumsum[i-1] if i > 0 else cumsum[i+j])

print(dp[0][N-1])
### BUGGY CODE ###

import sys

read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)


def solve():
    N, *a = map(int, read().split())
    a = tuple(a)
    memo = [[0] * N for _ in range(N)]

    def f(i, j):
        n = j - i + 1
        if i == j:
            if n % 2 == r:
                s = a[i]
            else:
                s = -a[i]
            memo[i][j] = s
            return s
        if n % 2 == r:
            s = max(f(i, j - 1) + a[j], f(i + 1, j) + a[i])
        else:
            s = min(f(i, j - 1) - a[j], f(i + 1, j) - a[i])
        memo[i][j] = s
        return s

    r = N % 2
    f(0, N - 1)
    return memo[0][N - 1]


print(solve())


### FIXED CODE ###

import sys

read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)


def solve():
    n, *a = map(int, read().split())
    a = tuple(a)
    dp = [[0] * n for _ in range(n)]
    for i in range(n):
        dp[i][i] = a[i]
    for i in range(n - 2, -1, -1):
        for j in range(i + 1, n):
            L = a[i] - dp[i + 1][j]
            R = a[j] - dp[i][j - 1]
            if L > R:
                dp[i][j] = L
            else:
                dp[i][j] = R
    return dp[0][n - 1]


print(solve())
### BUGGY CODE ###

import heapq

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

for i in range(m):
  for j in range(bc[i][0]):
    temp = heapq.heappop(a)
    temp2 = bc[i][1]
    if temp2 > temp:
      heapq.heappush(a, temp2)
    else:
      heapq.heappush(a, temp)
      break
      
print(sum(a))

### FIXED CODE ###

import heapq
 
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for i in range(m)]
bc.sort(key=lambda x: x[1], reverse = True)
heapq.heapify(a)
 
for i in range(m):
  for j in range(bc[i][0]):
    temp = heapq.heappop(a)
    temp2 = bc[i][1]
    if temp2 > temp:
      heapq.heappush(a, temp2)
    else:
      heapq.heappush(a, temp)
      print(sum(a))
      quit()
      
print(sum(a))
### BUGGY CODE ###

x,y,z,K=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

tmp=[]
for i in range(x):
    for j in range(y):
        tmp.append(a[i]+b[j])
tmp.sort(reverse=True)
ans=[]
for i in tmp:
    for j in range(z):
        ans.append(i+c[j])
ans.sort(reverse=True)
for i in range(K):
    print(ans[i])

### FIXED CODE ###

x,y,z,K=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ans=[]
for i in range(x):
    for j in range(y):
        if (i+1)*(j+1)>K:
            break
        for k in range(z):
            if (i+1)*(j+1)*(k+1)>K:
                break
            ans.append(a[i]+b[j]+c[k])
ans.sort(reverse=True)
for i in range(K):
    print(ans[i])
### BUGGY CODE ###

n = int(input())
ary = list(map(int,input().split()))
b = (len(ary)+1)//2-1
for i in range(n):
    a = ary.copy()
    del a[i]
    a.sort()
    print(a[b])

### FIXED CODE ###

n = int(input())
ary = list(map(int,input().split()))
a = sorted(ary)
b = (len(ary)+1)//2-1
for i in range(n):
    if a[b] < ary[i]:
        print(a[b])
    elif a[b] == ary[i]:
        print(a[b+1])
    elif a[b] > ary[i]:
        print(a[b+1])
### BUGGY CODE ###

n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


def kitaichi(num):
    return ((num+1)/ 2)

t = [0] * n
for i in range(n):
    t[i] = kitaichi(p[i])

ans = 0
for i in range(n-k+1):
    tmp = sum([t[x] for x in range(i, i+k)])
    ans = max(ans,tmp)

print(ans)

### FIXED CODE ###

n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)
### BUGGY CODE ###

import numpy as np

h, w, d = map(int, input().strip().split(" "))
a = np.array([[int(i) for i in input().strip().split(" ")] for _ in range(h)])
q = int(input().strip())
lr = [input().strip().split(" ") for _ in range(q)]
rs = [None for _ in range(h * w)]
cs = [None for _ in range(h * w)]
for _r, _a in enumerate(a):
    for _c, __a in enumerate(_a):
        rs[__a - 1] = _r
        cs[__a - 1] = _c
rs_d = [rs[i::d] for i in range(d)]
cs_d = [cs[i::d] for i in range(d)]
costs = [
    np.cumsum(
        np.abs(np.array(_rs[1:]) - np.array(_rs[:-1])) +
        np.abs(np.array(_cs[1:]) - np.array(_cs[:-1]))) for _rs, _cs in zip(rs_d, cs_d)
]
for l, r in lr:
    l = int(l) - 1
    r = int(r) - 1
    if l == r:
        print(0)
    elif l < d:
        print(costs[r % d][r // d - 1])
    else:
        print(costs[r % d][r // d - 1] - costs[l % d][l // d - 1])


### FIXED CODE ###

import numpy as np

h, w, d = map(int, input().strip().split(" "))
a = [[int(i) for i in input().strip().split(" ")] for _ in range(h)]
q = int(input().strip())
lr = [input().strip().split(" ") for _ in range(q)]
rs = [None for _ in range(h * w)]
cs = [None for _ in range(h * w)]
for _r, _a in enumerate(a):
    for _c, __a in enumerate(_a):
        rs[__a - 1] = _r
        cs[__a - 1] = _c
rs_d = [rs[i::d] for i in range(d)]
cs_d = [cs[i::d] for i in range(d)]
costs = [
    np.cumsum(
        np.abs(np.array(_rs[1:]) - np.array(_rs[:-1])) +
        np.abs(np.array(_cs[1:]) - np.array(_cs[:-1]))) for _rs, _cs in zip(rs_d, cs_d)
]
for l, r in lr:
    l = int(l) - 1
    r = int(r) - 1
    if l == r:
        print(0)
    elif l < d:
        print(costs[r % d][r // d - 1])
    else:
        print(costs[r % d][r // d - 1] - costs[l % d][l // d - 1])
### BUGGY CODE ###

def main():
    import sys
    from collections import deque
    def input(): return sys.stdin.readline().rstrip()

    def bfs():
        inf = 1e7

        dist = [[inf]*w for _ in range(h)]
        dist[xs][ys] = 0
        que = deque([(xs, ys)])
        dx = [-1, 0, 1, 0]
        dy = [0, 1, 0, -1]
        while que:
            x, y = que.popleft()
            for i in range(4):
                nx, ny = x, y
                for _ in range(k):
                    nx += dx[i]
                    ny += dy[i]
                    if 0 <= nx < h and 0 <= ny < w:
                        if field[nx][ny] == '@': break
                        if dist[nx][ny] <= dist[x][y]: break
                        if dist[nx][ny] > dist[x][y] + 1:
                            dist[nx][ny] = dist[x][y] + 1
                            que.append((nx, ny))
        
        if dist[xg][yg] == inf:
            print(-1)
        else:
            print(dist[xg][yg])


               

    h, w, k = map(int, input().split())
    xs, ys, xg, yg = map(lambda x: int(x)-1, input().split())
    field = [input() for _ in range(h)]
    bfs()


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import deque
def input(): return sys.stdin.readline().rstrip()

def main():
    
    h, w, k = map(int, input().split())
    xs, ys, xg, yg = map(lambda x: int(x)-1, input().split())
    field = [input() for _ in range(h)]

    inf = 1e7

    dist = [[inf]*w for _ in range(h)]
    dist[xs][ys] = 0
    que = deque([(xs, ys)])
    dx = [-1, 0, 1, 0]
    dy = [0, 1, 0, -1]
    while que:
        x, y = que.popleft()
        for i in range(4):
            nx, ny = x, y
            for _ in range(k):
                nx += dx[i]
                ny += dy[i]
                if nx < 0 or nx >= h or ny < 0 or ny >= w: break
                if field[nx][ny] == '@' or dist[nx][ny] <= dist[x][y]: break
                if dist[nx][ny] > dist[x][y] + 1:
                    dist[nx][ny] = dist[x][y] + 1
                    que.append((nx, ny))
        
    if dist[xg][yg] == inf:
        print(-1)
    else:
        print(dist[xg][yg])
    
if __name__ == '__main__':
    main()
### BUGGY CODE ###

n,q = map(int,input().split())
s = input()
lr_list = [list(map(int,input().split())) for nesya in range(q)]
for lr in lr_list:
  hoge = s[lr[0]-1:lr[1]]
  print(hoge.count('AC'))

### FIXED CODE ###

n,q = map(int,input().split())
s = input()
lr_list = [list(map(int,input().split())) for nesya in range(q)]
hoge = [0]*(n+1)
for i in range(n):
  hoge[i+1] = hoge[i] + (1 if s[i:i+2] == 'AC' else 0)
for lr in lr_list:
  l = lr[0]
  r = lr[1]
  print(hoge[r-1] - hoge[l-1])
### BUGGY CODE ###

N = int(input())
def dividor(K):
    X = [0]*K
    num = K
    for i in range(2,num+1):
        while(num%i == 0):
            X[i-1] +=1
            num = num // i
    ans = 1
    for i in range(1,K):
        ans = ans * (X[i] + 1)
    return ans
sum = 1
for i in range(2,N+1):
    sum += i * dividor(i)
print(sum)

### FIXED CODE ###

N = int(input())
ans = 0
for j in range(1,N+1):
    Y = N//j
    ans += Y*(Y+1)*j//2
print(ans)
### BUGGY CODE ###

from math import gcd

def gcd3(a, b, c):
  return gcd(gcd(a, b), c)

K = int(input())

res = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      res += gcd3(a, b, c)
      
print(res)

### FIXED CODE ###

from math import gcd

def gcd3(a, b, c):
  return gcd(gcd(a, b), c)

K = int(input())

res = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      res += gcd3(a, b, c)
      
print(res)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N=int(input().rstrip('\n'))
S=list(input().rstrip('\n'))
score = [S.count('R'),S.count('W')]
sta = 'R'
for i in range(N-1):
  if S[i] != sta:
    a = S[:i].count('W')
    b = S[i:].count('R')
    score.append(max(a,b))
    sta = S[i]
print(min(score))


### FIXED CODE ###

import sys
input = sys.stdin.readline

N=int(input().rstrip('\n'))
S=list(input().rstrip('\n'))
score = [S.count('R'),S.count('W')]
sta = 'R'
ws = 0
rs = S.count('R')
sto = 0
for i in range(N):
  if S[i] != sta:
    if sta=='W':
      ws += sto
      sto = 1
      score.append(max(rs,ws))
      sta ='R'
    else:
      rs -= sto
      sto = 1
      score.append(max(rs,ws))
      sta ='W'
  else:
    sto += 1
print(min(score))
### BUGGY CODE ###

from collections import deque
n,m = map(int,input().split())

turo = [[] for i in range(n)]
q = deque()
his = []

def root(x):
    if par[x] == x:
        return x
    else:
        return root(par[x])

for i in range(m):
    a,b = map(int,input().split())
    turo[a-1].append(b-1)
    turo[b-1].append(a-1)

par = [i for i in range(n)]
q.append(0)
his.append(0)

while len(q) > 0:
    #print(q)
    room = q.popleft()
    #print(room+1)
    for room2 in turo[room]:
        if room2 not in his:
            his.append(room2)
            q.append(room2)
            par[room2] = room

if len(his) < n:
    print("No")
    exit()
 
print("Yes")
for i in range(1,n):
    print(par[i]+1)

### FIXED CODE ###

from collections import deque
import sys
n,m = map(int,input().split())
 
turo = [[] for i in range(n)]
q = deque()
his = [False]*n
for i in range(m):
    a,b = map(int,input().split())
    turo[a-1].append(b-1)
    turo[b-1].append(a-1)
 
par = [i for i in range(n)]
rank = [sys.maxsize for i in range(n)]
rank[0] = 0
q.append(0)
 
while len(q) > 0:
    #print(q)
    room = q.popleft()
    
    if not his[room] :
        his[room] = True
    else:
        continue
    for room2 in turo[room]:
        if rank[room] < rank[room2]:
            q.append(room2)
            par[room2] = room
            rank[room2] = rank[room]+1
 
if len(his) < n:
    print("No")
    exit()
 
print("Yes")
for i in range(1,n):
    print(par[i]+1)
### BUGGY CODE ###

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
t = 0
sum_a = [0]
for i in range(n):
  if t + a[i] <= k:
    t += a[i]
    sum_a.append(t)
  else:
    break
sum_b = [0]
t = 0
for i in range(m):
  if t + b[i] <= k:
    t += b[i]
    sum_b.append(t)
  else:
    break
ans = []
for i in range(len(sum_a)):
  for j in range(len(sum_b)):
    if sum_a[i] + sum_b[j] <= k:
      ans.append(i + j)
print(max(ans))

### FIXED CODE ###

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
t = 0
sum_a = [0]
for i in range(n):
  if t + a[i] <= k:
    t += a[i]
    sum_a.append(t)
  else:
    break
sum_b = [0]
t = 0
for i in range(m):
  if t + b[i] <= k:
    t += b[i]
    sum_b.append(t)
  else:
    break
ans = []
j = 0
for i in range(len(sum_a)):
  while sum_a[i] + sum_b[len(sum_b) - j - 1] > k:
    j += 1
  ans.append(i + len(sum_b) - j - 1)
print(max(ans))
### BUGGY CODE ###

from collections import deque

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

Ndmin=[0]*(N-1)
for i in range(1,N):
    tmp=deque([i])
    dmin=deque([0])
    Dmin=[10000]*(N)
    while tmp:
        E=tmp.popleft()
        d=dmin.popleft()
        Dmin[E-1]=min(d,Dmin[E-1])
        if E<N:
            if d+1<Dmin[E]:
                tmp.append(E+1)
                dmin.append(d+1)
        if E>1:
            if d+1<Dmin[E-2]:
                tmp.append(E-1)
                dmin.append(d+1)
        if E==X and d+1<Dmin[Y-1]:
            tmp.append(Y)
            dmin.append(d+1)
        if E==Y and d+1<Dmin[X-1]:
            tmp.append(X)
            dmin.append(d+1)
        
    for ii in range(i,N):
        Ndmin[Dmin[ii]-1]+=1

for i in range(N-1):
    print(Ndmin[i])

### FIXED CODE ###

N,X,Y=map(int,input().split())
A=[]
for i in range(N-1):
    A.append([-1]*(N-1-i))

Ndmin=[0]*(N-1)
for i in range(N-1):
    for j in range(i+1,N):
        Ndmin[min(j-i,abs(X-i-1)+1+abs(Y-j-1),abs(X-j-1)+1+abs(Y-i-1))-1]+=1

for k in range(N-1):
    print(Ndmin[k])
### BUGGY CODE ###

import sys

stdin = sys.stdin

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

n, m, K = na()
b = []
for i in range(n):
    b.append(ns())

ans = 999999999999999
for ptn in range(1<<m-1):
    lans = 0
    x = ptn
    while x > 0:
        lans += x&1
        x //= 2

    to = [0] * n
    for i in range(1,n):
        if ptn>>i-1&1:
            to[i] = i
        else:
            to[i] = to[i-1]
    f = [0] * n
    ok = True
    for j in range(m):
        plus = [0] * n
        for r in range(n):
            plus[to[r]] += ord(b[r][j])-ord("0")
            if plus[to[r]] > K:
                ok = False
                break

        if not ok: break
        reset = False
        for r in range(n):
            if f[r] + plus[r] > K:
                reset = True
        if reset:
            lans += 1
            f = plus
        else:
            for i in range(n):
                f[i] += plus[i]
    if not ok:
        continue
    ans = min(ans, lans)
print(ans)


### FIXED CODE ###

import sys

stdin = sys.stdin

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

n, m, K = na()
b = []
for i in range(n):
    b.append(ns())

ans = 999999999999999
for ptn in range(1<<n-1):
    lans = 0
    x = ptn
    while x > 0:
        lans += x&1
        x //= 2

    to = [0] * n
    for i in range(1,n):
        if ptn>>i-1&1:
            to[i] = i
        else:
            to[i] = to[i-1]
    f = [0] * n
    ok = True
    o = ord("0")
    for j in range(m):
        plus = [0] * n
        for r in range(n):
            plus[to[r]] += ord(b[r][j])-o
            if plus[to[r]] > K:
                ok = False
                break

        if not ok:
            break
        reset = any(f[r] + plus[r] > K for r in range(n))
        if reset:
            lans += 1
            f = plus
        else:
            for i in range(n):
                f[i] += plus[i]
    if not ok:
        continue
    ans = min(ans, lans)
print(ans)
### BUGGY CODE ###

import sys
from operator import itemgetter


class BinaryIndexedTreeCustom:
    def __init__(self, n, init, func):
        self.size = n
        self.tree = [init] * (n + 1)
        self.depth = n.bit_length()
        self.init = init
        self.func = func

    def get(self, i):
        s = self.init
        t = self.tree
        f = self.func
        while i > 0:
            s = f(s, t[i])
            i -= i & -i
        return s

    def put(self, i, x):
        n = self.size
        t = self.tree
        f = self.func
        while i <= n:
            t[i] = f(t[i], x)
            i += i & -i


n, *aaa = map(int, sys.stdin.buffer.read().split())
bit1 = BinaryIndexedTreeCustom(n, 0, max)
bit2 = BinaryIndexedTreeCustom(n, n + 1, min)
aaa_with_index = list(enumerate(aaa, start=1))
aaa_with_index.sort(key=itemgetter(1))
ans = 0
for i, a in aaa_with_index:
    li = bit1.get(i)
    ri = bit2.get(n - i)
    ans += a * (i - li) * (ri - i)
    bit1.put(i, i)
    bit2.put(n + 1 - i, i)
print(ans)


### FIXED CODE ###

import sys
from operator import itemgetter


class BinaryIndexedTreeCustom:
    def __init__(self, n, init, func):
        self.size = n
        self.tree = [init] * (n + 1)
        self.depth = n.bit_length()
        self.init = init
        self.func = func

    def get(self, i):
        s = self.init
        while i > 0:
            s = self.func(s, self.tree[i])
            i -= i & -i
        return s

    def put(self, i, x):
        while i <= self.size:
            self.tree[i] = self.func(self.tree[i], x)
            i += i & -i


n, *aaa = map(int, sys.stdin.buffer.read().split())
bit1 = BinaryIndexedTreeCustom(n, 0, max)
bit2 = BinaryIndexedTreeCustom(n, n + 1, min)
aaa_with_index = list(enumerate(aaa, start=1))
aaa_with_index.sort(key=itemgetter(1))
ans = 0
for i, a in aaa_with_index:
    li = bit1.get(i)
    ri = bit2.get(n - i)
    ans += a * (i - li) * (ri - i)
    bit1.put(i, i)
    bit2.put(n + 1 - i, i)
print(ans)
### BUGGY CODE ###

N = int(input())
sum=1

for i in range(1, N+1):
    sum = (sum*i)

print(sum%1000000007)

### FIXED CODE ###

N = int(input())
sum=1

for i in range(1, N+1):
    sum=(sum*i)%1000000007

print(sum)
### BUGGY CODE ###

N = int(input())
S = input()

ls = []
for s in S:
    ls += list(s)

ans = 0
for i in range(N-2):
    for j in range(i, N-1):
        for k in range(j, N):
            if ls[i] == ls[j]:
                continue
            elif ls[j] == ls[k]:
                continue
            elif ls[i] == ls[k]:
                continue
            else:
                if k-j == j-i:
                    continue
                else:
                    ans += 1

print(ans)


### FIXED CODE ###

n = int(input())
s = input()
c = s.count

# 文字列からR,G,Bをひとつずつを選んだときの組み合わせ総数をカウントする
ans = c("R")*c("G")*c("B")

for a in range(n-2):  # 基準
    for j in range((n-a+1)//2):  # 文字の距離
        # 全ての組み合わせから距離の等しい組み合わせを排除する
        # 距離の等しい組み合わせは、a,b,cの組み合わせのうち、
        # aを固定、a-bの距離をjで固定したとき,b=a+j, c=a+2*jと表せる
        if s[a] != s[a+j] and s[a+j] != s[a+2*j] and s[a+2*j] != s[a]:
            ans -= 1
print(ans)
### BUGGY CODE ###

import itertools
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))

ans = []
for n in range(1, N+1):
    C = list(itertools.combinations(S,n))
    for c in C:
        if sum(c)%10 == 0:
            ans.append(0)
        else:
            ans.append(sum(c))
print(max(ans))

### FIXED CODE ###

N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))

s = sum(S)
if s % 10 != 0:
    print(s)
else:
    S.sort()
    for i in S:
        if i % 10 != 0:
            s -= i
            break
    if s % 10 == 0:
        print(0)
    else:
        print(s)
### BUGGY CODE ###

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

price.sort(reverse=True)
for i in range(m):
    # print(i+1)
    price[0] //= 2
    price.sort(reverse=True)
    # print(price)
print(sum(price))
    

### FIXED CODE ###

import heapq

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

heapq.heapify(price)
# print(price)
for i in range(m):
    # print(i+1)
    a = int(heapq.heappop(price)/2)
    heapq.heappush(price,a)
    # print(price)
print(-sum(price))
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
a=1
exist=[]
for i in range(N):
  if A[i] in exist:
    a=0
    print("NO")
    break
  else:
    exist+=[A[i]]
if a==1:
  print("YES")

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
a=0
for i in range(N-1):
  if A[i]==A[i+1]:
    print("NO")
    a=1
    break
if a==0:
  print("YES")
### BUGGY CODE ###

S = list(input())
for i in range(len(S)):
    if S[i] != '?':
        S[i] = int(S[i])
    else:
        S[i] = -1

R = [[None]*10 for i in range(13)]
for i in range(13):
    for j in range(10):
        R[i][j] = (10*i+j) % 13

Q = [[] for i in range(13)]
for j in range(10):
    for i in range(13):
        Q[R[i][j]] += [[i,j]]

dp = [[0]*13 for i in range(len(S)+1)]
dp[0][0] = 1

for i in range(len(S)):
    for j in range(13):
        if S[i]!=-1:
            dp[i+1][j] += dp[i][Q[j][S[i]][0]]
        else:
            for k in range(10):
                dp[i+1][j] += dp[i][Q[j][k][0]]

print(dp[len(S)][5]%1000000007)

### FIXED CODE ###

S = list(input())
for i in range(len(S)):
    if S[i] != '?':
        S[i] = int(S[i])
    else:
        S[i] = -1

R = [[None]*10 for i in range(13)]
for i in range(13):
    for j in range(10):
        R[i][j] = (10*i+j) % 13

Q = [[] for i in range(13)]
for j in range(10):
    for i in range(13):
        Q[R[i][j]] += [[i,j]]

dp = [[0]*13 for i in range(len(S)+1)]
dp[0][0] = 1

for i in range(len(S)):
    for j in range(13):
        if S[i]!=-1:
            dp[i+1][j] += dp[i][Q[j][S[i]][0]]%1000000007
        else:
            for k in range(10):
                dp[i+1][j] += dp[i][Q[j][k][0]]%1000000007

print(dp[len(S)][5]%1000000007)
### BUGGY CODE ###

a,b,x = map(int,input().split())
for i in range(a,b+1):
    if i % x == 0:
        print(((b-i)//x) + 1)
        exit()
print(0)

### FIXED CODE ###

a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
plus = []
minus = []
for i in range(n):
  plus.append(a[i]+i+1)
  minus.append(i+1-a[i])
c = 0
for i in range(n-1):
  for j in range(i,n):
    if plus[i] == minus[j]:
      c += 1
print(c)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
plus = dict()
minus = dict()
for i in range(n):
  num = i+1
  p = a[i] + num
  m = num - a[i]
  if p in plus:
    plus[p] += 1
  else:
    plus[p] = 1
  if (m) in minus:
    minus[m] += 1
  else:
    minus[m] = 1
c = 0
for v in plus.keys():
  if v in minus:
    c += plus[v] * minus[v]
print(c)