Harryxun/stf_run huggingface dataset:
=int(input())
a=list(map(int,input().split()))
ans=sum(a)
for i in range (n):
  if ans>abs(ans-2*a[i]):
    ans=ans-2*a[i]
print(abs(ans))


### FIXED CODE ###

n=int(input())
b=list(map(int,input().split()))
ans=sum(b)
ansl=[]
for i in range(n-1,0,-1):
  ans-=2*b[i]
  ansl.append(abs(ans))
print(min(ansl))
def get_articulation_points(G, N, start=0):
    v_min = [0]*N; order = [None]*N
    result = []; count = 0
    def dfs(v, prev):
        nonlocal count
        r_min = order[v] = count
        fcnt = 0; p_art = 0
        count += 1
        for w in G[v]:
            if w == prev:
                continue
            if order[w] is None:
                ret = dfs(w, v)
                p_art |= (order[v] <= ret)
                r_min = min(r_min, ret)
                fcnt += 1
            else:
                r_min = min(r_min, order[w])
        p_art |= (r_min == order[v] and len(G[v]) > 1)
        if (prev == -1 and fcnt > 1) or (prev != -1 and p_art):
            result.append(v)
        return r_min
    dfs(start, -1)
    return result

n, m = map(int, input().split())
G = [[] for i in range(n)]
for i in range(m):
    s, t = map(int, input().split())
    G[s].append(t)
    G[t].append(s)
*_,=map(print,sorted(get_articulation_points(G, n)))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
write = sys.stdout.write

N, M = map(int, readline().split())

G = [[] for i in range(N)]
for i in range(M):
    u, v = map(int, readline().split())
    G[u].append(v)
    G[v].append(u)

# a chain decomposition
def construct(G, N):
    P = [0]*N
    G0 = [[] for i in range(N)]
    V = []
    lb = [0]*N
    def dfs(v, p):
        P[v] = p
        V.append(v)
        lb[v] = len(V)
        for w in G[v]:
            if w == p:
                continue
            if lb[w]:
                if lb[v] < lb[w]:
                    # a backedge
                    G0[v].append(w)
                continue
            # a tree edge
            dfs(w, v)
    dfs(0, -1)

    used = [0]*N
    first = 1
    B = []
    used[0] = 1
    ap = [0]*N
    for u in V:
        if not used[u]:
            # (u, p) is a bridge
            p = P[u]
            B.append((u, p) if u < p else (p, u))
            if len(G[u]) > 1:
                ap[u] = 1
            if len(G[p]) > 1:
                ap[p] = 1
        cycle = 0
        for v in G0[u]:
            w = v
            while w != u and not used[w]:
                used[w] = 1
                w = P[w]
            if w == u:
                cycle = 1
        if cycle:
            if not first:
                ap[u] = 1
            first = 0
    # v is a cut vertex
    A = [v for v in range(N) if ap[v]]

    return B, A

B, A = construct(G, N)

for v in A:
    write("%d\n" % v)
H, W, K = map(int, input().split())
items = []

start = []
diff = float("inf")
p = []
prev = [[False] * W for _ in range(H)]
for i in range(H):
    items.append(list(input()))
    for j in range(W):
        s = items[i][j]
        if s == "S":
            start = [i, j]
            diff = min(diff, min(i, H - 1 - i, min(j, W - 1 - j)))
            p = [i, j]
            prev[i][j] = True

from collections import deque

que = deque([])

dx = [-1, 0, 0, 1]
dy = [0, 1, -1, 0]

for i in range(4):
    x = dx[i]
    y = dy[i]
    if 0 <= start[0] + y <= H - 1 and 0 <= start[1] + x <= W - 1:
        tmp = items[start[0] + y][start[1] + x]
        if tmp == ".":
            que.append((start[0] + y, start[1] + x))
k = K
while len(que) != 0:
    q = que.popleft()
    a = q[0]
    b = q[1]
    if abs(start[0] - a) + abs(start[1] - b) > K:
        continue

    prev[a][b] = True
    c = min(min(a, H - 1 - a), min(b, W - 1 - b))
    if c < diff:
        diff = c
        p = (a, b)

    for i in range(4):
        x = dx[i]
        y = dy[i]
        if 0 <= a + y <= H - 1 and 0 <= b + x <= W - 1:
            if prev[a + y][b + x]:
                continue
            tmp = items[a + y][b + x]
            if tmp == ".":
                que.append((a + y, b + x))
    k -= 1

ans = 1
if diff == 0:
    print(ans)
else:
    print(ans + (K - 1 + diff) // K)


### FIXED CODE ###

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

sum_num = A + B + C

before_A = A
before_B = B
before_C = C
count = 1

if before_A % 2 == 1 or before_B % 2 == 1 or before_C % 2 == 1:
    print(0)
    exit()

while True:
    after_A = (sum_num - before_A) // 2
    after_B = (sum_num - before_B) // 2
    after_C = (sum_num - before_C) // 2
    if after_A == before_A and after_B == before_B and after_C == before_C:
        print(-1)
        exit()

    if after_A % 2 == 0 and after_B % 2 == 0 and after_C % 2 == 0:
        count += 1
        before_A = after_A
        before_B = after_B
        before_C = after_C

    else:
        print(count)
        exit()
s  = input()
t = input()
result = len([a,b for a,b in zip(s,t) if a != b])
print(result)

### FIXED CODE ###

s = input()
t = input()
result = len([a for a,b in zip(s,t) if a != b])
print(result)
N, M = map(int, input().split())
l=[]
for i in range(M):
    L = list(input().split())
    l.append(l[1:]) 
s=list(input().split())
c=0
for i in range(2**N):
    for j in range(M):
        a = 0
        for k range(N):
            if ((i >>k) == 1 and k+1 in l[j]:
                a += 1
        if a%2 == s[j]:
            d *= 1
        else:
            d *= 0
    if d == 1:
        c += 1
print(c)

### FIXED CODE ###

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

s = []

for i in range(m):
    array = list(map(int, input().split()))
    s.append(array[1:])

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

ans = 0
for i in range(2**n):
    flag =True
    for j in range(m):
        a = 0
        for k in range(n):
            if ((i >>k)&1) == 1 and k+1 in s[j]:
                a += 1
        if a%2 == check[j]:
            continue
        else:
            flag = False
            break
    if flag is True:
        ans += 1
print(ans)
N, T = map(int, input().filter(" "))
t = list(map(int, input().filter(" ")))

shower = 0

for i in range(1, N):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

print(shower)


### FIXED CODE ###

N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(0, N-1):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

shower += T
print(shower)
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
 
int main() {
  int N;
  cin >> N;
	vector<int> a(N);
	rep(i,N) cin>>a[i];
	sort(a.rbegin(),a.rend());
	long int ans=0;
	rep(i,N){
	  if (i%2==0)ans+=a[i];
	  else ans-=a[i];
	}
	cout << ans << "\n";
}

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
A=0
B=0
a.sort(reverse=True)
for i in range(N):
  if i%2==0:
    A+=a[i]
  else:
    B+=a[i]
print(A-B)
import sys
from itertools import combinations

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    n, k = map(int, input().split())

    for i in range(1, k+1):
        mul = 1
        div = 1

        for j in range(i):
            if j == i-1:
                mul *= ((n-k+1)-j)
                div *= (i-j)
            else:
                mul *= ((n-k+1)-j) * ((k-1)-j)
                div *= (i-j) * ((i-1)-j)

        print(int((mul / div) % (10**9+7)))


### FIXED CODE ###

import sys
import math

def input():
    return sys.stdin.readline().rstrip()

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

if __name__ == "__main__":
    n, k = map(int, input().split())

    for i in range(1, k+1):
        if n-k+1 >= i and k-1 >= i-1:
            print((combination(n-k+1, i) * combination(k-1, i-1)) % (10**9+7))
        else:
            print(0)
n,m=map(int,input().split())
p=[[] for i in range(n)]
y=[]
nl=[]
for i in range(m):
    t1,t2=map(int,input().split())
    p[t1-1].append(t2)
for i in range(n):
    tl=p[i].sort()
    for j in range(len(p[i])):
        u=str(i+1)
        w=tl.index(p[i][j])
        d=str(w+1)
        while len(u)<6:
            u="0"+u
        while len(d)<6:
            d="0"+d
        t=u+d
        nl.append(t)
for i in range(m):
    print(nl[i])

### FIXED CODE ###

n,m=map(int,input().split())
p=[]
for i in range(m):
    t1,t2=map(int,input().split())
    p.append([i,t1,t2])
p.sort(key=lambda x:x[2])
c=[1 for i in range(n+1)]
num=[]
for i,pre,yea in p:
    tmp=str(pre).zfill(6)+str(c[pre]).zfill(6)
    num.append([i,tmp])
    c[pre]+=1
num.sort()
for i in num:
    print(i[1])
def lcs_len(x, y):
    indices = [0]
    for y_i in y:
        t_index = 0
        for i, index in enumerate(indices, 1):
            c_index = x.find(y_i, t_index) + 1
            if c_index:
                if i < len(indices):
                    t_index = indices[i]
                    indices[i] = min(c_index, t_index)
                else:
                    indices.append(c_index)
                    break
    print(len(indices) - 1)


def answer(X, Y):
    m, n = len(X), len(Y)
    C = [[0] * (n + 1) for _ in range(m + 1)]
    for i in range(1, m + 1):
        for j in range(1, n + 1):
            if X[i - 1] == Y[j - 1]:
                C[i][j] = C[i-1][j-1] + 1
            else:
                C[i][j] = max(C[i][j -1], C[i -1][j])
    return C[m][n]


if __name__ == '__main__':
    q = int(input())
    for _ in range(q):
        X = list(input())
        Y = list(input())
        print(lcs_len(X, Y))

### FIXED CODE ###

def lcs_better(X, Y):
    costs = [0]
    for c in Y:
        for i in range(len(costs) - 1, -1, -1):
            tmp = X.find(c, costs[i])
            if tmp + 1:
                if i + 1 < len(costs):
                    costs[i + 1] = min(costs[i + 1], tmp + 1)
                else:
                    costs.append(tmp + 1)
    return len(costs) - 1


def answer(X, Y):
    m, n = len(X), len(Y)
    C = [[0] * (n + 1) for _ in range(m + 1)]
    for i in range(1, m + 1):
        for j in range(1, n + 1):
            if X[i - 1] == Y[j - 1]:
                C[i][j] = C[i-1][j-1] + 1
            else:
                C[i][j] = max(C[i][j -1], C[i -1][j])
    return C[m][n]


if __name__ == '__main__':
    q = int(input())
    for _ in range(q):
        X = input()
        Y = input()
        print(lcs_better(X, Y))
def is_kaibun(st):
  f = True
  for x,y in zip(st, st[::-1]):
    if x != y:
      f = False
      break
  return f

S = input()
ans = False
if is_kaibun(S):
  if is_kaibun(S[:(len(S)-1)/2+1]):
    ans = is_kaibun(S[(len(S)+3)/2+1])
if ans:
  print('Yes')
else:
  print('No')
  

### FIXED CODE ###

def is_kaibun(st):
  f = True
  for x,y in zip(st, st[::-1]):
    if x != y:
      f = False
      break
  return f
 
S = input()
ans = False
if is_kaibun(S):
  if is_kaibun(S[:(len(S)-1)//2]):
    ans = is_kaibun(S[(len(S)+3)//2-1:])
if ans:
  print('Yes')
else:
  print('No')
print(^(-1*int(input()) // 2))

### FIXED CODE ###

print(-1*(-1*int(input()) // 2))
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
A = reversed(A)
B = set(A)
B = list(B)
B = B[::-1]
C = N-1
ans = 0
if N%2 == 0:
  ans += B[0]
  for i in range(N//2-1):
    ans += 2*B[i+1]
else:
  ans += B[0]
  ans += B[N//2]
  for i in range(N//2-1):
    ans += 2*B[i+1]
print(ans)   

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
B = A[::-1]
C = N-1
ans = 0
if N%2 == 0:
  ans += B[0]
  for i in range(N//2-1):
    ans += 2*B[i+1]
else:
  ans += B[0]
  ans += B[N//2]
  for i in range(N//2-1):
    ans += 2*B[i+1]
print(ans)
while 1:
	if "?" in raw_input.split():
		break
	a,b,op = map(int,raw_input().split()
	print a op b

### FIXED CODE ###

while 1:
	x = raw_input().split()
	a,op,b = int(x[0]),x[1],int(x[2])
	if op == "+":
		print a+b
	elif op == "-":
		print a-b
	elif op == "/":
		print a/b
	elif op == "*":
		print a*b
	else:
		break
time = int(input())
h = time/3600
time%3600
m = time/60
s = time%60
print("%d:%d:time = int(input())
h = time/3600
time%=3600
m = time/60
s = time%60
print("%d:%d:%d"%(h,m,s))%d"%(h,m,s))

### FIXED CODE ###

time = int(input())
h = str(time // 3600)
m = str((time % 3600)//60)
s = str(time%60)
print(h+":"+m+":"+s)
A=int(input())
B=int(input())

if 1<=A<=9 and 1<=B<=9:
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

i = list(map(int, input().split()))
 #出力：['s_1', 's_2']
A=i[0] #出力：s_1
B=i[1] #出力：s_2

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


### FIXED CODE ###

n, q = map(int, input().split())
s = input()
t = [None] * q
d = [None] * q
for i in range(q):
    t[i], d[i] = input().split()
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if c >= 0 and s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c < 0:
            l = m
            break
        if c >= n:
            r = m
            break
    else:
        r = m
a = l
l, r = 0, n + 1
while r - l > 1:
    m = (l + r) // 2
    c = m - 1
    for i in range(q):
        if c < n and s[c] == t[i]:
            if d[i] == 'L':
                c -= 1
            else:
                c += 1
        if c >= n:
            r = m
            break
        if c < 0:
            l = m
            break
    else:
        l = m
b = n - l
print(max(0, n - a - b))
N, K = input().strip().split()
h = list(map(int, input().split()))
count = 0
for i in range(N):
    if h[i] >= K:
        count += 1
print(count)

### FIXED CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
count = [i for i in h if i >= K]
print(len(count))
n = int(input())
cnt = [0]*100001
ans = 0
a = list(map(int,input().split()))
a.sort()

for i in range(n):
    j = a[i]
    while j<100001:
        if cnt[j]<2:
            cnt[j]+=1
            j+=a[i]
        else:
            break
for i in range(n):
    if cnt[a[i]]<2: ans+=1
print(ans)

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int,input().split())))
am = a[-1]+1
b = [0]*am
for i in a:
    b[i]+=1
    if b[i]==1:
        for j in range(i*2,am,i):
            b[j]=2
print(b.count(1))
a,b,c=map(int,input().split)

if a+b>=b+c:
    print(10*a+b+c)
    
elif a+b<=b+c:
    prnt(a+10*b+c)

### FIXED CODE ###

a,b,c=map(int,input().split())
if a>=b and a>=c:
    print(a*10+b+c)
elif b>=a and b>=c:
    print(b*10+a+c)
elif c>=a and c>=b:
    print(c*10+a+b)
def calc(x):
  ret = 0
  while x % 100 == 0:
    x /= 100
	ret += 1
	return ret

d, n = list(map(int, input().split()))
cnt = 0
val = 0
while cnt < n:
  val +=1
  if(calc(val) == D):
    cnt+=1
  print(val)
  return


### FIXED CODE ###

d, n = list(map(int, input().split()))
cnt = 0
i = 1

while True:
  if(d == 0 and i % 100 != 0):
    cnt += 1    
  if(d != 0 and i % (100 ** d) == 0 and i % (100 ** (d+1)) != 0):
    cnt += 1
  if(cnt == n):
    print(i)
    exit()
  i += 1
N = int(input())

num = 0
if N < 10:
  print(N)
elif N < 100:
  print(9)
elif N < 1000:
  print(9+ n-99)
  
elif N <10000:
  print(909)

elif N < 100000:
  print(90909)


### FIXED CODE ###

A, B, C = (int(i) for i in input().split(" "))
 
D = A - B

 
if C - D <= 0:
  print(0)
else:
  print(C-D)
output = []

for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if output == "Bad":
    print(output)
else:
    output == "Good"
    print(output)

### FIXED CODE ###

output = []
 
for (i, x) in enumerate(input()):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)
p,q,r=map(int,input().split())
if p>=q and  p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(p+q)

### FIXED CODE ###

s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()
if u==s:
    print(a-1,b)
if u==t:
    print(a,b-1)
a, b = map(int,input().split())
c = a * b
if c%2 = 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a, b = map(int,input().split())
c = a * b
if c%2 == 0:
  print("Even")
else:
  print("Odd")
n,m = map(int, input().split())
dic = {}
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    
    if a in dic.keys():
        tmp = dic[a]
        tmp.append(b)
        dic[a] = tmp
    else:
        tmp = [b]
        dic[a] = tmp
    
    if b in dic:
        tmp = dic[b]
        tmp.append(a)
        dic[b] = tmp
    else:
        tmp = [a]
        dic[b] = tmp

dist = {}
queue = []
visited = []
pre = {}

dist[0] = 0 
queue.append(0)

while len(queue) > 0:
    v = queue.pop(0)
    
    for i in dic[v]:
        if i in visited:
            continue
        
        visited.append(i)
        dist[i] = dist[v] + 1
        pre[i]= v
        queue.append(i)


print("Yes")
for i in range(m):
    ans = 0
    
    if(i == 0):
        continue
    
    ans = pre[i]
    ans += 1
    print(ans)

### FIXED CODE ###

from collections import deque

n,m = map(int, input().split())
dic = {}

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

dic = [[] for _ in range(n + 1)]

for a,b in AB:
    a -= 1
    b -= 1

    dic[a].append(b)
    dic[b].append(a)

#dist = {}
queue = deque([0])
visited = []
pre = [-1] * (n+1)

#dist[0] = 0 
queue.append(0)

while queue:
    v = queue.popleft()
    
    for i in dic[v]:
        if pre[i] == -1:
        #dist[i] = dist[v] + 1
            pre[i]= v
            queue.append(i)

print("Yes")
for i in range(n):
    ans = 0
    
    if(i == 0):
        continue
    
    ans = pre[i]
    ans += 1
    print(ans)
n = int(input())
arr = list(map(int, input().split()))
rev = sorted(arr, reverse = True)
for i in range(n):
  if arr[i] == rev[-1]:
    print(rev[-2])
  else:
	print(rev[-1])

### FIXED CODE ###

n = int(input())
arr = []
for i in range(n):
    arr.append(int(input()))
rev = sorted(arr, reverse = True)
for i in range(n):
    if arr[i] == rev[0]:
        print(rev[1])
    else:
        print(rev[0])
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,min(A,B)):
    if A%i==0 and B%i==0:
        result.append(i)
result.reverse()
print(result[K-1])

### FIXED CODE ###

"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,101):
    if A%i==0 and B%i==0:
        result.append(i)
result.reverse()
print(result[K-1])
def visiting(values,hp,vp,item):
	if not (0<=hp<len(values)): return
	if not (0<=vp<len(values[hp])): return
	if item!=values[hp][vp]: return
	values[hp][vp]=True
	search(values,hp-1,vp,item)
	search(values,hp+1,vp,item)
	search(values,hp,vp-1,item)
	search(values,hp,vp+1,item)

def solve(values):
	count=0
	for i in range(len(values)):
		for j in range(len(values[i])):
			if values[i][j] in ['@','#','*']:
				visiting(values,i,j,values[i][j])
				count+=1
	return count

def main():
	line,values=input(),list()
	while line!='0 0':
		H,W = list(map(int,line.strip().split(' ')))
		value = list()
		for _ in range(H):
			value.append(list(x for x in input().strip()))
		values.append(value)
		line = input()
	for value in values:
		print(solve(value))

if __name__=='__main__':
	main()

### FIXED CODE ###

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

import sys
sys.setrecursionlimit(10**6)

def search(field,hp,vp,item):
	if not (0<=hp<len(field)): return
	if not (0<=vp<len(field[hp])): return
	if item!=field[hp][vp]: return
	field[hp][vp]=True
	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
		search(field,hp+dh,vp+dv,item)
#	search(field,hp-1,vp,item)
#	search(field,hp+1,vp,item)
#	search(field,hp,vp-1,item)
#	search(field,hp,vp+1,item)

def solve(field):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(field)):
		for j in range(len(field[i])):
			if field[i][j] in valid_items:
				search(field,i,j,field[i][j])
				count+=1
	return count

def main():
	line = input().strip()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		field = list()
		for _ in range(H):
			field.append(list(input().strip()))
		print(solve(field))
		line = input().strip()

if __name__=='__main__':
	main()
#!usr/bin/env pypy3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)

def main():
    N, M, K = LI()
    A = LI()
    B = LI()

    i, j, ans, cum = 0, 0, 0, 0

    while True:
        if (i < N) and (j < M):
            if (cum + A[i] <= K) and (cum + B[j] <= K):
                if A[i] <= B[j]:
                    cum += A[i]
                    i += 1
                else:
                    cum += B[j]
                    j += 1
            elif cum + A[i] <= K:
                cum += A[i]
                i += 1
            elif cum + B[j] <= K:
                cum += B[j]
                j += 1
            else:
                break
            ans += 1
        elif i < N:
            if cum + A[i] <= K:
                cum += A[i]
                i += 1
                ans += 1
            else:
                break
        elif j < M:
            if cum + B[j] <= K:
                cum += B[j]
                j += 1
                ans += 1
            else:
                break
        else:
            break

    print(ans)

main()


### FIXED CODE ###

#!usr/bin/env pypy3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import copy
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)


def main():
    N = I()
    c = [1] * (N + 1)
    
    for i in range(2, N + 1):
        k = i
        while k <= N:
            c[k] += 1
            k += i

    ans = sum(i * c for (i, c) in enumerate(c))
    print(ans)
main()
s = input()
r = 700

for i in range(3):
    if s[i] == 'o':
        700 += 100
print(r)

### FIXED CODE ###

s = input()
r = 700
 
for i in range(3):
    if s[i] == 'o':
        r += 100
print(r)
n = float(input())
a = list(map(float, input().split()))

s = 1
for i in a:
    s = s * i

x = (n-1)*sum(a)
print(s/x)

### FIXED CODE ###

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

for i in a:
    ans = ans + 1/i
print(1/ans)