Harryxun/stf_run huggingface dataset:
import sys
import collections
import bisect


def main():
    n = int(input())
    AList = list(map(int, input().split()))
    ASum = sum(a)
    c = 0
    for i in range(n):
        c += AList[i]
        if c >= ASum / 2:
            k = i
            break
    ans = min(2 * c - ASum, ASum - 2 * c + 2 * AList[k])
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import collections
import bisect


def main():
    n = int(input())
    AList = list(map(int, input().split()))
    ASum = sum(AList)
    c = 0
    for i in range(n):
        c += AList[i]
        if c >= ASum / 2:
            k = i
            break
    ans = min(2 * c - ASum, ASum - 2 * c + 2 * AList[k])
    print(ans)


if __name__ == '__main__':
    main()
from sys import stdin
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

prime_list=[i for i in range(1,10001) if is_prime(i)]
oppai=[0]*10000
for i in range(3, 10000):
    if i in prime_list and (i+1)/2 in prime_list:
        oppai[i-1]=oppai[i-2]+1
    else:oppai[i-1]=oppai[i-2]
#print(oppai)
N=list(map(int,stdin.readline().strip().split()))[0]
for _ in range(N):
    count = 0
    a,b=map(int,(input().split()))
    if a==b:
        if a in  prime_list and ((a+1)/2) in  prime_list:
            count+=1
    else:
        if a>=2:
            bb=oppai[b-1]
            aa=oppai[a-2]
            count = bb - aa
        else:
            bb = oppai[b - 1]
            count = bb

    print(count)



### FIXED CODE ###

from sys import stdin
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
prime_list=[i for i in range(2,100000) if is_prime(i)]
oppai=[0]*100000
oppai[1]=0
before=1
for num in prime_list:
    if (num+1)//2 in prime_list:
        oppai[before:num - 2] = [oppai[before]] * (num-1 - before)
        oppai[num-1]=oppai[before]+1
    else:oppai[before:num-1]=[oppai[before]]*(num-before)
    before=num-1
oppai[99991:99999]=[oppai[99990]]*8
N=list(map(int,stdin.readline().strip().split()))[0]
for _ in range(N):
    count = 0
    a,b=list(map(int,stdin.readline().strip().split()))
    if a==b:
        bb = (oppai[b - 1])
        aa = (oppai[a - 2])
        count = bb - aa
        print(count)
    else:
        if a>=2:
            bb = oppai[b - 1]
            aa = oppai[a - 2]
            count = bb - aa
            print(count)
        else:
            bb = oppai[b - 1]
            count = bb
            print(count)
n, k = map(int, input().split())
li_light = list(map(int, input().split()))
 
def func(tuyosa):
  basho = [0] * n
  # 光が当たっている部分
  for i in range(n):
    min = i + 1 - tuyosa[i]
    max = i + 1 + tuyosa[i]
    a = 0
    while a <= n:
      if 1 <= min <= n:
        basho[min - 1] += 1
      min += 1
      if min > max:
        break
  return basho

if k > 41:
  k = 41
for i in range(k):
  li_light = (func(li_light))
  if li_light.count(n) == n:
    break
 
for k in li_light:
  print(k, end=" ")


### FIXED CODE ###

full = input()
num = 0
for i in full:
  if num < 3:
    num += 1
    print(i, end="")
N=int(input())
A=[]
for i in range(2):
    A_ = list(map(int, input().split()))
    A.append(A_)
    A[i].append(0)
A.append([0]*(N+1))
# A=[[0]*(N+1),[0]*(N+1),[0]*(N+1)]
# A[0]=list(map(int,input().split()))
# A[1]=list(map(int,input().split()))

max_candidate=[]
x=0
y=0
ans=A[0][0]
for i in range(N):
  if A[y][x+1]>=A[y+1][x]:
    ans+=A[0][x+1]
    x+=1
  #下方向移動の方が値が大きい場合、最大値の候補としてリストに追加
  else:
    ans_can=ans
    for j in range(x,N):
      ans_can+=A[1][j]
    max_candidate.append(ans_can)7
    x+=1
print(max(max_candidate))


### FIXED CODE ###

N=int(input())
A=[]
for i in range(2):
    A_ = list(map(int, input().split()))
    A.append(A_)
    A[i].append(0)
A.append([0]*(N+1))
# A=[[0]*(N+1),[0]*(N+1),[0]*(N+1)]
# A[0]=list(map(int,input().split()))
# A[1]=list(map(int,input().split()))

max_candidate=[]
x=0
y=0
ans=A[0][0]
for i in range(N):
  if A[y][x+1]>=A[y+1][x]:
    ans+=A[0][x+1]
    x+=1
  #下方向移動の方が値が大きい場合、最大値の候補としてリストに追加
  else:
    ans_can=ans
    for j in range(x,N):
      ans_can+=A[1][j]
    max_candidate.append(ans_can)
    ans+=A[0][x+1]
    x+=1
print(max(max_candidate))
n = int(input())
li = list(map(int,input().split()))

xyz = [[0,0,0]for _ in range(n)]
xyz[0] = [0,0,0]

mod = 10**9+7

for i in range(n-1):
    ix = xyz[i].index(li[i])
    for j in range(3):
        if j == ix:
            xyz[i+1][j] = xyz[i][j] + 1
        else:
            xyz[i+1][j] = xyz[i][j]

point = 3
for i in range(1,n):
    point *= xyz[i].count(li[i])
    point %= mod
print(point)

### FIXED CODE ###

n = int(input())
li = list(map(int,input().split()))

xyz = [[0,0,0]for _ in range(n)]
xyz[0] = [0,0,0]

mod = 10**9+7

for i in range(n-1):
    if li[i] not in xyz[i]:
        print(0)
        exit()
    ix = xyz[i].index(li[i])
    for j in range(3):
        if j == ix:
            xyz[i+1][j] = xyz[i][j] + 1
        else:
            xyz[i+1][j] = xyz[i][j]

point = 3

for i in range(1,n):
    point *= xyz[i].count(li[i])
    point %= mod
print(point)
n=int(input())
s=input()
l=list()
if '#' in s:
  for i in range(n):
    if s[i]=='#':
      l.append(i)
  for i in range(len(l)-1):
    if l[i+1]-l[i]>=2:
      cnt=l[i+1]
  if (cnt-l[0]+1)//2>l.index(cnt)+1:
    print(l.index(cnt)+1)
  else:
    print(cnt-l[0]-l.index(cnt))
else:
  print(0)

### FIXED CODE ###

n=int(input())
s=input()
accum=[0]*n
if s[0]=="#":
    accum[0]=1
for i in range(n-1):
    accum[i+1]+=accum[i]+(s[i+1]=="#")
accum=[0]+accum
ans=10**18
for i in range(n+1):
    ans=min(ans,accum[i]+n-i-accum[n]+accum[i])
#print(accum)
print(ans)
S=len(input())
print(x*S)

### FIXED CODE ###

S=len(input())
print('x'*S)
import numpy as np
import math
n=int(input())
A=np.empty((n))
B=np.zeros((n))
count=0


for i in range(n):
    A[i]=int(input())
for i in range(n):
    for j in range(2,int(math.sqrt(A[i])+1)):
        if A[i]%j==0:
            B[i]=1 ##素数でないなら1を入力
        break


for i in range(n):
    if B[i]==0:
        count=count+1

print(count)



### FIXED CODE ###

from math import sqrt

n=int(input())

count=0

for i in range(n):
    x=int(input())
    if x==1:
        count=count+1
    elif x!=2 and x%2==0:
        count=count+1
    elif x==2 or x==3 or x==5:
        count=count
    else:
        for j in range(2,int(sqrt(x))+1): 
            if x%j==0:
                count=count+1
                break


print(n-count)
N,M,X = map(int,input().split())

A =  []
S = [0 for _ in range(N)] 
min_value = 0 
score=[0 for _ in range(N)] 

for x in range(N):
  A.append(list(map(int,input().split())))

for x in range(N):
  min_value += A[x][0]
  
sucess = 0

for bit in range(2**N):
  for i in range(N):
    if (bit >> i) & 1:
      S.append(A[i][0])
      for x in range(M):
        score[x] += A[i][x+1]
  flag = 0

  for k in score:
    if k >= 10:
      flag += 1
    if flag ==len(score):
      if min_value >= sum(S):
        min_value = sum(S)
        sucess += 1 
        
  score=[0 for _ in range(N)]
  S =[]
  
if sucess > 0:
	print(min_value)
else:
  print("-1")

### FIXED CODE ###

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

A =  []
S = [0 for _ in range(N)] 
min_value = 0 
score=[0 for _ in range(M)] 

for x in range(N):
  A.append(list(map(int,input().split())))

for x in range(N):
  min_value += A[x][0]


sucess = 0

for bit in range(2**N):
  for i in range(N):
    if (bit >> i) & 1:
      S.append(A[i][0])
      for x in range(M):
        score[x] += A[i][x+1]
  flag = 0
  #print(score)
  for k in score:
    if k >= X:
      flag += 1
    if flag ==len(score):
      #print("S",S)
      if min_value >= sum(S):
        min_value = sum(S)
        sucess += 1 
        
  score=[0 for _ in range(M)]
  S =[]
  
if sucess > 0:
	print(min_value)
else:
  print("-1")
#C
X,N = map(int,input().split())
p = list(map(int,input().split()))
r = 100
for i in range(100,min(p)-2,-1):
    if i in p:
        pass
    else:
        if abs(r-X) >= abs(i-X):
            r = i
        else:
            pass
print(r)

### FIXED CODE ###

#C
X,N = map(int,input().split())
p = list(map(int,input().split()))
r = 101
for i in range(101,-1,-1):
    if i in p:
        pass
    else:
        if abs(r-X) >= abs(i-X):
            r = i
print(r)
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
 
n = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))
 
print ans

### FIXED CODE ###

def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
 
N = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))
 
print(ans)
A = input()

S = 0
for i in A:
  S = S + A(i)
  
if (int(A) % S) == 0:
  print("Yes")
else:
  print("No")  


### FIXED CODE ###

A = input()

S = 0
for i in A:
  S = S + int(i)
  
if (int(A) % S) == 0:
  print("Yes")
else:
  print("No")
n = int(raw_input())
 
INFTY = float('inf')
 
color = [0 for i in range(n)]
m = [[INFTY for i in range(n)] for j in range(n)]
d = [INFTY for i in range(n)]
k = [-1 for i in range(n)]

for i in range(n):
    G = map(int, raw_input().split())
    for j in range(n):
        if G[j] != -1:
            m[i][j] = G[j]

d[0] = 0
 
while 1:
    cost = INFTY
    for i in range(n):
        if color[i] != 2 and d[i] < cost:
            cost = d[i]
            u = i

    if cost == INFTY:
        break
    
    color[u] = 2
 
    for v in range(n):
        if color[v] != 2 and m[u][v] != INFTY and m[u][v] < d[v]:
            d[v] = m[u][v]
            k[v] = u
            color[v] = 1

sum = 0
for i in range(n):
    if p[i] != -1:
        sum += m[i][k[i]]
print sum

### FIXED CODE ###

n = int(raw_input())
 
INFTY = float('inf')
 
color = [0 for i in range(n)]
M = [[INFTY for i in range(n)] for j in range(n)]
d = [INFTY for i in range(n)]
p = [-1 for i in range(n)]
 
def MST():
  d[0] = 0
 
  while True:
    cost = INFTY
    for i in range(n):
      if color[i] != 2 and d[i] < cost:
        cost = d[i]
        u = i
 
    if cost == INFTY:
      break
     
    color[u] = 2
 
    for v in range(n):
      if color[v] != 2 and M[u][v] != INFTY and M[u][v] < d[v]:
        d[v] = M[u][v]
        p[v] = u
        color[v] = 1
 
  sum = 0
  for i in range(n):
    if p[i] != -1:
      sum += M[i][p[i]]
  return sum
 
for i in range(n):
  G = map(int, raw_input().split())
  for j in range(n):
   if G[j] != -1:
     M[i][j] = G[j]
 
print MST()
import collections

n = input()
line = input().split()
odd = line[::2]
even = line[1::2]
o = collections.Counter(odd)
e = collections.Counter(even)
maxoddcnt = o.most_common()[0][1]
maxevencnt = e.most_common()[0][1]

#すべての値が同じときは半分を置換する
if odd == even:
    print(len(odd))
    exit(0)

#奇数列，偶数列それぞれの最頻の文字が同じ場合は，いずれかを2番目に多い文字に置換しなければならない
if o.most_common()[0][0] == e.most_common()[0][0]:
    if o.most_common()[1][1] + e.most_common()[0][1] > o.most_common()[0][1] + e.most_common()[1][1]:
        maxoddcnt = o.most_common()[1][1]
    else: #if o.most_common()[1][1] + e.most_common()[0][1] <= o.most_common()[0][1] + e.most_common()[1][1] :
        maxevencnt = e.most_common()[1][1]

print(len(odd)-maxoddcnt+len(even)-maxevencnt)


### FIXED CODE ###

n = input()
n = n.replace('9','x')
n = n.replace('1','9')
n = n.replace('x','1')
print(n)
def solve(A, B, C, K):
    num = K

    if K <= A:
        return 1 * A

    num -= A
    ans = 1 * A

    if num <= B:
        return ans

    num -= B

    if num < 0:
        return ans

    return ans - num


A, B, C, K = map(int, input().split())
print(solve1(A, B, C, K))



### FIXED CODE ###

A, B, C, K = map(int, input().split())

if K <= A:
    print(K)
elif K <= A + B:
    print(A)
else:
    print(A - (K - (A + B)))
import numpy as np
import sys
sys.setrecursionlimit(10000000)

N, M, P = map(int, input().split())
ABC_d = {}
for m in range(M):
    A, B, C = map(int, input().split())
    if A in ABC_d:
        ABC_d[A].append([B, C - P])
    else:
        ABC_d[A] = [[B, C - P]]


cost = np.empty(N, dtype = int) - np.inf
cost[0] = 0

def solve(pos, already):
    global cost

    if not(pos in ABC_d): return
    # print (already)

    for B, C in ABC_d[pos]:
        if already[B - 1] == True:
            # if cost[B - 1] == np.inf:
            #     pass
            # elif cost[B - 1] < cost[pos - 1] + C:
            #     cost[B - 1] = np.inf
            #     solve(B, already)
            if cost[B - 1] == np.inf:
                pass
            elif cost[pos-1] == np.inf or cost[B - 1] < cost[pos - 1] + C:
                cost[B-1] = np.inf
                solve(B, already)
        elif cost[B - 1] < cost[pos - 1] + C:
            cost[B - 1] = cost[pos - 1] + C
            already2 = already.copy()
            already2[B - 1] = True
            solve(B, already2)


already = np.zeros(N, dtype = bool)
already[0] = True
solve(1, already)

if (cost[-1] == np.inf):
    print (-1)
else:
    print (max(0, int(cost[-1])))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

f_inf = sys.maxsize

N, M, P = map(int, input().split())
ABC_d = {}
for m in range(M):
    A, B, C = map(int, input().split())
    if A in ABC_d:
        ABC_d[A].append([B, C - P])
    else:
        ABC_d[A] = [[B, C - P]]

cost = [-f_inf] * N
cost[0] = 0

def solve(pos, cnt):
    global cost

    if not(pos in ABC_d): return
    if cnt > N: cost[pos-1] = f_inf;

    for B, C in ABC_d[pos]:
        if cost[B - 1] == f_inf or cost[B - 1] >= cost[pos - 1] + C:
            pass
        elif cost[pos-1] == f_inf:
            cost[B-1] = f_inf
            solve(B, cnt + 1)
        elif cost[B - 1] < cost[pos - 1] + C:
            cost[B - 1] = cost[pos - 1] + C
            solve(B, cnt + 1)

solve(1, 1)

if (cost[-1] == sys.maxsize):
    print (-1)
else:
    print (max(0, int(cost[-1])))
n,m=map(int,input().split())

if m>=2 and n>=2:
    print((n-2)*(m-2))
elif m==1 and n>=2:
    print(n-2)
elif n==1 and m>=2:
    print(m-2)
else:
    prnit(1)

### FIXED CODE ###

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

if m>=2 and n>=2:
    print((n-2)*(m-2))
elif m==1 and n>=2:
    print(n-2)
elif n==1 and m>=2:
    print(m-2)
else:
    print(1)
N=input
a=list(N)
b=len(a)
sum=0
for i in range(b):
  a[i]=int(a[i])
  sum += a[i]
  print(a[i])
N=int(N)
if(N%sum==0):
      print("Yes")
else:
      print("No")

### FIXED CODE ###

N=input()
a=list(N)
b=len(a)
sum=0
for i in range(b):
          a[i]=int(a[i])
          sum += a[i]
N=int(N)
if(N%sum==0):
              print("Yes")
else:
              print("No")
#import math
import fractions
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,x = iim()
xmod = list(map(lambda y:int(y)-x,input().split()))
#print(xmod)
num = xmod[0]
for i in xmod:
    gcd = fractions.gcd(num,i)

print(gcd)

### FIXED CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
A = iil()

if 2 in A:
    print('No')
else:
    print('Yes')
import sys
from collections import deque
def bfs():
    Q = deque()
    Q.append(0)
    #今の時刻
    i = 1
    while len(Q) > 0:
        x = Q.popleft()
        print(x)
        if x-i >= 0:
            T[i][x-i] = 1
            if x-i == X: return i
            Q.append(x-i)
        if 0 <= x and x <= X:
            T[i][x] = 1
            if x == X: return i
            Q.append(x)
        if x+i <= X:
            T[i][x+i] = 1
            if x+i == X: return i
            Q.append(x+i)
        i += 1

X = int(input())
INF = 10**9 +1
#時刻iで座標jに到着できるかどうか
T = [[0 for _ in range(X+1)] for _ in range(X**2)]
T[0][0] = 1
print(bfs())


### FIXED CODE ###

W, a, b = map(int,input().split())
print(max(b-(a+W),(a-(b+W)),0))
import random
A, B = map(int, input().split())
r = random.randrange(5)
if r == 0:
    print(1/0)
elif r == 1:
    print(A+B)
elif r == 2:
    while True:
        B += 1
else:
    X = [0] * (10**9)


### FIXED CODE ###

A, B = map(int, input().split())
print(max(A*2-1,A+B,B*2-1))
A X B = map(int,input().split(' '))
if X == '+':
  print(int(A) + int(B))
else:
  print(int(A) - int(B))

### FIXED CODE ###

A,X,B = map(str,input().split(' '))
if X == '+':
  print(int(A) + int(B))
else:
  print(int(A) - int(B))
s = input()

N = len(s)

i = 0
result = 0
count_a = 0
count_bc = 0

while i < N-2:
    if s[i] == 'A':
        while s[i] == 'A':
            count_a += 1
            i += 1
        
        if i >= N-1:
            break
        
#        if s[i] == 'B' and s[i+1] == 'C':
#            result += count_a - 1
                
        while s[i] == 'B' and s[i+1] == 'C':
            count_bc += 1
            i += 2
            if i >= N-1:
                break
        
        result += count_a * count_bc

        if i >= N-1:
            break
        
        if count_bc > 0 and s[i] == 'A':
            count_a = count_a
        else:
            count_a = 0
        
        count_bc = 0
                    
    else:
        i += 1
        
print(result)    

### FIXED CODE ###

s = input()

N = len(s)

i = 0
result = 0
count_a = 0
count_bc = 0

while i < N-2:
    if s[i] == 'A':
        while s[i] == 'A' and i < N-2:
            count_a += 1
            i += 1
        
        if i >= N-1:
            break
                        
        while s[i] == 'B' and s[i+1] == 'C':
            count_bc += 1
            i += 2
            if i >= N-1:
                break
        
        result += count_a * count_bc

        if i >= N-1:
            break
        
        if count_bc > 0 and s[i] == 'A':
            count_a = count_a
        else:
            count_a = 0
        
        count_bc = 0
                    
    else:
        i += 1
        
print(result)
import math


def kaijo(n):
    if n == 0:
        return 1
    return n * kaijo(n - 1)


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

ans = 0
for i in range(5):
    if b == 0:
        ans = 0
        break
    if a == b:
        ans = 1
        break
    if a ** i < b:
        continue
    ans = math.floor(b / (a ** (i - 1))) + kaijo(i-1)
    break

print(ans)


### FIXED CODE ###

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

plgcnt = 0
tapcnt = 1

flg=0

while(True):
    if tapcnt >= b:
        print(plgcnt)
        break
    tapcnt += a - 1
    plgcnt += 1
s = '0'
l = []
ans = 0
temp = -1
while s != '' :
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print(ans)

### FIXED CODE ###

s = '0'
l = []
ans = 0
temp = -1
n = int(raw_input())
for i in range(0, n):
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print(ans)
import math

def comb(n, r):
  return math.factorial(n)/(math.factorial(n-r)*math.factorial(r))

n, k = map(int, input().split())
mod = 10**9+7

for i in range(1, k+1):
  if i <= n-k+1:
    ans = comb(n-k+1, i) * comb(k-1, i-1)
    ans %= mod
  else:
    ans = 0
  print(int(ans))

### FIXED CODE ###

import math
from operator import mul
from functools import reduce

def comb(n, r):
  r = min(r, n-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())
mod = 10**9+7

for i in range(1, k+1):
  if i <= n-k+1:
    ans = comb(n-k+1, i) * comb(k-1, i-1)
    ans %= mod
  else:
    ans = 0
  print(ans)
n = import math
n = int(input())

A = list()
for i in range(5):
    A.append(int(input()))

min_num = min(A)

ans = math.ceil(n/min_num)+4


print(ans)

### FIXED CODE ###

import math
n = int(input())

A = list()
for i in range(5):
    A.append(int(input()))

min_num = min(A)

ans = math.ceil(n/min_num)+4


print(ans)
alphabetTable = dict.fromkeys([chr(i) for i in range(97, 123)], 0)

while True:
    text = input()

    if len(text) == 0:
        break

    for i in range(len(text)):
        if text[i].lower() in alphabetTable:
            alphabetTable[text[i].lower()] += 1

sortedTable = sorted(alphabetTable.keys())
for r in sortedTable:
    print(r,':',alphabetTable[r])

### FIXED CODE ###

alphabetTable = dict.fromkeys([chr(i) for i in range(97, 123)], 0)

while True:
    try:
        for text in input():
            for i in range(len(text)):
                if text[i].lower() in alphabetTable:
                    alphabetTable[text[i].lower()] += 1
    except EOFError:
        break

for r in sorted(alphabetTable):
    print(r,':',alphabetTable[r])
n = input()
S = map(str,raw_input().split(' '))
set_S = ()
for val in S:
	set_S.add(val)
list_S = set_S
q = input()
T = map(str,raw_input().split(' '))
C = []
for val in T:
	if val in list_S:
		C.append(val)
print len(C)

### FIXED CODE ###

n = input()
S = map(str,raw_input().split(' '))
set_S = set()
for val in S:
	set_S.add(val)
list_S = set_S
q = input()
T = map(str,raw_input().split(' '))
C = []
for val in T:
	if val in list_S:
		C.append(val)
print len(C)
N=int(input())

for i in range(1,N):
  if i*(i+1)//2 >= N:
    break
    
c = i*(i+1)//2 - N

for j in range(1,i+1):
  if j!=c:
    print(j)

### FIXED CODE ###

N=int(input())
k=1

for i in range(1,N+1):
  if i*(i+1)//2 >= N:
    k=i
    break
    
c = int(k*(k+1)//2 - N)

for j in range(1,k+1):
  if j!=c:
    print(j)
N, A, B = map(int, raw_input().split())
#t_li = []
cnt = 0
for i in range(len(N)):
    if A <= int(raw_input()) < B:
        cnt +=1
#    t_li.append(raw_input())

print N-cnt

### FIXED CODE ###

N, A, B = map(int, raw_input().split())
#t_li = []
cnt = 0
for i in range(N):
    if A <= int(raw_input()) < B:
        cnt +=1
#    t_li.append(raw_input())

print N-cnt
from collections import Counter
from functools import reduce
from operator import mul

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    b = Counter(a)
    return b

N = int(input())
A = list(map(int, input().split()))
if N == 1:
    print('1')
else:
    fac = prime_factorize(A[0]) | prime_factorize(A[1])
    for x in A[2:]:
        fac |= prime_factorize(x)
    ans = 0
    f = [pow(x[0],x[1],100000007) for x in fac.items()]
    lcm = reduce(mul,f)
    for x in A:
        ans = (ans + (lcm // x)) % 1000000007
    print(ans)

### FIXED CODE ###

from fractions import gcd

N = int(input())
A = list(map(int, input().split()))
if N == 1:
    print('1')
else:
    g = gcd(A[0],A[1])
    lcm = (A[0]*A[1]) // g
    for x in A[2:]:
        lcm = (lcm * x) // gcd(lcm,x)
    print(sum((lcm//x) for x in A)%1000000007)
from itertools import combinations
n = int(input())
arr = list(map(int, input().split()))
ans = 0
arr = list(combinations(arr, 2))
for i, j in arr:
    ans += i ^ j
print(ans % (10 ** 9 + 7))


### FIXED CODE ###

arr = list(map(int, input().split()))
ans = 'bust' if sum(arr) >= 22 else 'win'
print(ans)
s1=input()
s2=input().split()
a=sorted(s2,reverse=True)

max=int(a[0])
cnt=a[1:]
all=sum(int(i) for i in cnt)

if(max<all):
  print('Yes')
else
  print('No')



### FIXED CODE ###

s1=input()
s2=input().split()
n2=[int(i) for i in s2]
a=sorted(n2,reverse=True)

max=a[0]
cnt=a[1:]
all=sum(cnt)

if(max<all):
  print('Yes')
else:
  print('No')
L, R, d = list(map(int, input().split()))
result = 0
for i in range(L, R + 1):
  if i % d == 0:
    result += 1
print(result)L, R, d = list(map(int, input().split()))
result = 0
for i in range(L, R + 1):
  if i % d == 0:
    result += 1
print(result)

### FIXED CODE ###

L, R, d = list(map(int, input().split()))
result = 0
for i in range(L, R + 1):
  if i % d == 0:
    result += 1
print(result)
a,b = map(int,input())
print(a*b)

### FIXED CODE ###

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

print(a[0]*a[1])