Harryxun/stf_run huggingface dataset:
n = input()
hs = list(map(int,input().split(" ")))

step = 0
while(True):
  
  start = None
  stop = None
  
  for i,h in enumerate(hs):

    
    if(h>0 and start is None):
      start = i
    if(h==0 and start is not None and stop is None):
      stop = i
     	
  if(stop is None):
    stop =  len(hs)
    
  for i in range(start, stop):
    hs[i] -= 1
    
  step += 1
  
  if(sum(hs) == 0):
    break
    
print(step)
      
  

### FIXED CODE ###

n = input()
hs = list(map(int,input().split(" ")))

step = 0
while(True):
  
  if(sum(hs) == 0):
    break
  
  start = None
  stop = None
  
  for i,h in enumerate(hs):

    if(h>0 and start is None):
      start = i
    if(h==0 and start is not None and stop is None):
      stop = i
     	
  if(start is not None and stop is None):
    stop = len(hs)
    
  for i in range(start, stop):
    hs[i] -= 1
    
  step += 1
  
print(step)
A = int(input())  
else : print(int(A*(A-1)//2))

### FIXED CODE ###

A = int(input())  - 1
if A ==0 :print(A)
else : print(int(A*(A+1)//2))
N, K = list(map(int, input().split()))

Alist = [int(i) for i in input().split(' ')]
import math

#print(Alist)
my_list = [9,8,7,4,7,1,3]

Alist=sorted(Alist, reverse=True)
#print(sorted(Alist, reverse=True))


for i in range(K):
   Alist[0]=Alist[0]/2
   if N>1: 
      if Alist[0]<Alist[1]:
         temp=Alist[0]
         Alist[0]=Alist[1]
         Alist[1]=temp
      if Alist[0]<Alist[i]:
         temp=Alist[0]
         Alist[0]=Alist[i]
         Alist[i]=temp
      if i>2:
         if Alist[0]<Alist[i-1]:
            temp=Alist[0]
            Alist[0]=Alist[i-1]
            Alist[i-1]=temp
sum=0
#print(Alist)
for i in Alist:
   sum+=math.floor(i) 
print(int(sum))

### FIXED CODE ###

from heapq import heappush, heappop
import math
 
N,M = [int(i) for i in input().split(' ')]
inputList = [int(i) for i in input().split(' ')]
list = []
 
for i in inputList:
    heappush(list, -i)
 
for _ in range(M):
    heappush(list, math.ceil(heappop(list)/2))
    
print(-sum(list))
import math
n = int(input())
a = list(map(int, input().split()))

ans = 1
if n == 2:
    print(max(a))
else:
    for i in range(n):
        b = a[:i] + a[i + 1:]
        element = math.gcd(b[0], b[1])
        if n == 3:
            ans = max(ans, element)
        else:
            for j in range(2, n - 1):
                element = math.gcd(element, b[i])
            ans = max(ans, element)
    print(ans)


### FIXED CODE ###

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


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)

ans = 1
if n == 2:
    print(max(a))
else:
    l = [0] * (n + 1)
    r = [0] * (n + 1)
    for i in range(1, n):
        l[i] = gcd(l[i - 1], a[i - 1])
        r[n - i] = gcd(r[n - i + 1], a[-i])
    for i in range(n):
        m = gcd(l[i], r[i + 1])
        ans = max(ans, m)
    print(ans)
a,b = map(int, input().split())
cl=[]
tl=[]
for i in range(a):
    c,t = map(int, input().split())
    cl.append(c)
    tl.append(t)
    
ind=0
resut_list=[]
for p in range(a):
    if tl[ind]<=b:
        resut_list.append(cl[ind])
    ind+=1    

print(min(resut_list))

### FIXED CODE ###

n,t = map(int, input().split())
lst_c = []
lst_t = []
a = 0
b = 0
for i in range(n):
    a,b = map(int, input().split())
    if b <= t:
        lst_c.append(a)
if lst_c == []:
    print("TLE")
else:
    print(min(lst_c))
a,b,c=map(int,input().split())
sum=a+b+c
if a+b==c or a+c=b or b+c==a :
    print("Yes")
else :
    print("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b==c or a+c==b or b+c==a  :
    print("Yes")
else :
    print("No")
a = int(input())
 c = a % 10
 
if c in ［ 3］:
  print("bon")
elif c in ［ 0,1,6,8］:
  print("pon")
else:
  print("hon")


input()

### FIXED CODE ###

n = int(input())
c = n % 10
 
if c in [3]:
  print("bon")
elif c in [0,1,6,8]:
  print("pon")
else:
  print("hon")
a, b, c = map(int, input().split())

x = c - b - a
if x > 0 && a * b * 4 < x * x:
	print("Yes")
else:
    print("No")

### FIXED CODE ###

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

x = c - b - a
if x > 0 and a * b * 4 < x * x:
	print("Yes")
else:
    print("No")
i = int(input())
l = [int(i) for i in list(input())]

j = 0
t = 0
while True:
  k = l[j] % 2
  if k == 1:
    break
  else:
    l[j] /= 2
    
  j = j + 1 % i
  if j == 0:
    t += 1
print(t)

### FIXED CODE ###

i = int(input())
l = [int(n) for n in input().split(' ')]

t = 0
bool = True
while bool:
    t += 1
    for j in range(len(l)):
        if l[j] % 2 == 1:
            bool = False
            break
        else:
            l[j] /= 2
print(t-1)
s = input()

def fact(n):
    if n > 1:
        return n * fact(n-1)
    else:
        return 1

print(fact(s.count("B")))

### FIXED CODE ###

s = list(input())
n = len(s)
ans = 0
count = 0

for i in range(n):
    if s[i] == "W":
        ans += i
        count += 1

print(ans-count*(count-1)//2)
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

N = INT()

i = 1
while N > 26**i:
	N -= 26**i
	i += 1


ans = ""
for j in range(i-1, 0, -1):
	ans += ascii_lowercase[N//(26**j)]
	N %= 26**j

ans += ascii_lowercase[N-1]

print(ans)




### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

N = INT()
i = 1
while N > 26**i:
	N -= 26**i
	i += 1

ans = ""
N -= 1
for j in range(i-1, -1, -1):
	ans += ascii_lowercase[N//(26**j)]
	N %= 26**j

print(ans)
S = list(input())
T = list(input())
defolt = 1000
for i in range(len(S)-len(T)):
    ans = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            ans += 1
        defolt = min(defolt,ans)
print(ans)

### FIXED CODE ###

S = list(input())
T = list(input())
defolt = 1000
for i in range(len(S)-len(T)+1):
    ans = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            ans += 1
    defolt = min(defolt,ans)
print(defolt)
N, K = map(int, input().split())
costs = list(map(int, input().split())) + [0] * 100010


def chmin(i, j, dp, costs):
    if dp[i+j] > dp[i] + abs(costs[i] - costs[i+j]):
        dp[i+j] = dp[i] + abs(costs[i] - costs[i+j])
        return True
    return False


dp = [float('inf')] * 100010
dp[0] = 0
for i in range(N-1):
    for j in range(1, K+1):
        chmin(i, j, dp, costs)

print(dp[N-1])

### FIXED CODE ###

N, K = map(int, input().split())
vals = list(map(int, input().split()))
costs = [0] * 100010
for i in range(len(vals)):
    costs[i] = vals[i]

dp = [float('inf')] * 100010
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i-j >= 0:
            dp[i] = min(dp[i], dp[i-j] + abs(costs[i] - costs[i-j]))

# print(dp)
print(dp[N-1])
N, K = map(int, input().split())
A = list(map(int, input().split()))
foo = [[1 for k in range(N)] for k in range(41)]
for k in range(N):
    foo[0][k] = A[k]
if K <42:
    for q in range(K):
        for k in range(N):
            for j in range(1, min(foo[q-1][k]+1, N-k)):
                foo[k+j][q] +=1
            for j in range(1, min(foo[q-1][k]+1, k+1)):
                foo[k-j][q] +=1
        count =0
        for l in range(N):
            if foo[q][l] < N:
                break
            else:
                count +=1
        
        if count == N:
            break
        
                        
        #print(foo)
    print(" ".join(map(str, foo[q])))

     
else:
    print("N "*(N-1)+"N")




### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
foo = [[0 for k in range(N)] for k in range(42)]
for k in range(len(A)):
    foo[0][k] = A[k]
if K <42:
    for q in range(K):
        unko = [0 for k in range(N)]
        for k in range(N):
            if k + foo[q][k]+1 < N:
                unko[k + foo[q][k]+1] -=1
            unko[max(k - foo[q][k], 0)] +=1
        unchi = 0
        for k in range(N):
            unchi += unko[k]
            foo[q+1][k] = unchi
        #print(unko)
        #print(foo[q+1])
        count =0
        for l in range(N):
            if foo[q+1][l] < N:
                break
            else:
                count +=1
        
        if count == N:
            break
        
                        
        #print(foo)
    print(" ".join(map(str, foo[q+1])))

     
else:
    print((str(N)+" ")*(N-1)+str(N))
def main():
  N=int(input())
  S=input()
  n=len(S)
  if n%2==0:
    half=S[0:n/2]
    if S=half+half:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
main()
  

### FIXED CODE ###

def main():
  N=int(input())
  S=input()
  n=len(S)
  T=S[0:n//2]
  if n%2==0:
    if S==T+T:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
main()
x, a = list(input())
print('100'[if x >= a::2])

### FIXED CODE ###

x, a = map(int, input().split())
print(int('100'[x < a::2]))
int(input()) = N
for a in range(1,10):
  for b in range(1,10):
  if N==a*b:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n=int(input())
for a in range(1,10):
  for b in range(1,10):
    if n==a*b:
      print("Yes")
      exit()
    
print("No")
import sympy

n = int(input())

ans = 0
if n > 1:
    tmp = sympy.factorint(n)
    for v in tmp.values():
        i = 1
        while v > 0:
            if v - i >= 0:
                v -= i
                ans += 1
                i += 1
            else:
                break
print(ans)

### FIXED CODE ###

import collections

n = int(input())


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)
    return a


ans = 0
if n > 1:
    tmp = collections.Counter(prime_factorize(n))
    for v in tmp.values():
        i = 1
        while v > 0:
            if v - i >= 0:
                v -= i
                ans += 1
                i += 1
            else:
                break
print(ans)
import heapq

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

max_score = float('-inf')
for i in range(N, 2 * N + 1):
    rm_count_1 = i - N
    rm_count_2 = N - rm_count_1
    a_list_1 = []
    a_list_2 = []
    for k in a[0:i]:
        if len(a_list_1) >= N:
            heappushpop(a_list_1, k)
        else:
            heappush(a_list_1, k)
    for k in a[i:3*N]:
        if len(a_list_2) >= N:
            heappushpop(a_list_2, -k)
        else:
            heappush(a_list_2, -k)
    sum_1 = sum(a_list_1)
    sum_2 = sum(a_list_2)
    score = sum_1 + sum_2
    if score > max_score:
        max_score = score

print(max_score)

### FIXED CODE ###

from heapq import heappush, heappushpop

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

a_list_1 = []
a_list_2 = []
for i in a[0:N]:
    heappush(a_list_1, i)
for i in list(reversed(a))[0:N]:
    heappush(a_list_2, -i)

sum_1 = sum(a_list_1)
sum_2 = sum(a_list_2)
sum_arr_1 = [0] * (N + 1)
sum_arr_1[0] = sum_1
sum_arr_2 = [0] * (N + 1)
sum_arr_2[-1] = sum_2
for k in range(N, 2 * N):
    l = heappushpop(a_list_1, a[k])
    sum_1 += a[k] - l
    sum_arr_1[k - N + 1] = sum_1

for k in reversed(range(N, 2 * N)):
    l = heappushpop(a_list_2, -a[k])
    sum_2 += -a[k] - l
    sum_arr_2[k - N] = sum_2

max_score = float('-inf')
for s1, s2 in zip(sum_arr_1, sum_arr_2):
    score = s1 + s2
    if score > max_score:
        max_score = score

print(max_score)
x,y,z=map(int,input().split())
print('A'+y[0]+'C')

### FIXED CODE ###

x,y,z=map(str,input().split())
print('A'+y[0]+'C')
X, t = map(int, input().spilt())

if X - t > 0:
    print(X - t)
else:
    print(0)

### FIXED CODE ###

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

if X - t > 0:
    print(X - t)
else:
    print(0)
N = int(input())
l = list(map(int, input().split()))
sum = 0
for i in range((N*(N-1))//2):
    for j in range(i):
        a = l[i]*l[j]
        sum+=a
print(sum)


### FIXED CODE ###

N = int(input())
l = list(map(int, input().split()))
sum = 0
for i in range((N*(N-1))//2):
    for j in range(i+1,N):
        a = l[i]*l[j]
        sum+=a
print(sum)
a,b = int(input())
if a >= 10 or b >= 10:
  print(-1)
else:
  print(a*b)

### FIXED CODE ###

import sys
from collections import Counter, deque, defaultdict
from math import factorial
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

a, b= MAP()

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)
A = input ()
B = input ()
C = input ()

if (A==B and A!=C or B==C and B!=A or A==C and A!=B ):
  print("Yes")
  
else:
  print("No")

### FIXED CODE ###

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

if (A==B==C or  A!=C and A!=B and B!=C):
  print("No")

else:
  print("Yes")
x,y=map(str,input().split())
h =['A','B','C','D','E','F']
a=0
b=0
for v, i in enumerate(h):
  if x == v:
    a = i
  elif y ==v:
    b = i
if a<b:
  print('<')
elif a=b:
  print('=')
else:
  print('>')

### FIXED CODE ###

x,y=map(str,input().split())
if int(x,16)>int(y,16):
  print(">")
elif int(x,16)==int(y,16):
  print("=")
else:
  print("<")
H,W = [int(x) for x in input().split()]
li = []
op = []
def get_wh(index):
    h = index//W
    if(h%2==0):
        w = index%W +1
    else:
        w = W - index%W
    return h+1,w

for i in range(H):
    if(i%2 == 0):
        li+=[int(x)%2 for x in input().split()]
    else:
        li+=[int(x)%2 for x in input().split()][::-1]

for index,i in enumerate(li):
    if(i==1):
        li[index]-=1
        li[index+1]=1-li[index+1]
        op.append(get_wh(index)+get_wh(index+1))

print(len(op))
for i in op:
    print(i[0],i[1],i[2],i[3])


### FIXED CODE ###

H,W = [int(x) for x in input().split()]
li = []
op = []
def get_wh(index):
    h = index//W
    if(h%2==0):
        w = index%W +1
    else:
        w = W - index%W
    return h+1,w

for i in range(H):
    if(i%2 == 0):
        li+=[int(x)%2 for x in input().split()]
    else:
        li+=[int(x)%2 for x in input().split()][::-1]

for index in range(len(li[:-1])):
    if(li[index]==1):
        li[index]=0
        li[index+1]=1-li[index+1]
        op.append(get_wh(index)+get_wh(index+1))

print(len(op))
for i in op:
    print(i[0],i[1],i[2],i[3])
s=input()
n=int(s)
sn=0
for d in s:
  sn+=int(d)
if n%sn==0:
  Print("Yes")
else:
  print("No")

### FIXED CODE ###

s=input()
n=int(s)
sn=0
for d in s:
  sn+=int(d)
if n%sn==0:
  print("Yes")
else:
  print("No")
N, K = [int(x) for x in input().split(' ')]
m = 10**9 + 7
import math
def combination(n, r):
  return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  
for k in range(1, K+1):
  if k in [1, K]:
    print(combination(N - K + 1, k) % m)
  else:
    print(combination(N - K + 1, k) * (K-1) % m)

### FIXED CODE ###

N, K = [int(x) for x in input().split(' ')]
m = 10**9 + 7
fact = [1] * (N+1)
for i in range(1, N+1):
  fact[i] = fact[i-1] * i
  
def combination(n, r):
  return fact[n] // fact[r] // fact[n-r]
  
for k in range(1, K+1):
  print(combination(N-K+1, k) % m * combination(K-1, k-1) % m)
INF = float('inf')
H,W = map(int,input().split())
s = [input() for _ in range(H)]

cost = [[INF]*W for _ in range(H)]
cost[0][0] = 1

def bfs(h,w):
    if h-1>=0:
        if s[h-1][w] == '.' and cost[h-1][w] > cost[h][w]+1:
            cost[h-1][w] = cost[h][w]+1
            bfs(h-1,w)
    if h+1<H:
        if s[h+1][w] == '.' and cost[h+1][w] > cost[h][w]+1:
            cost[h+1][w] = cost[h][w]+1
            bfs(h+1,w)
    if w-1>=0:
        if s[h][w-1] == '.' and cost[h][w-1] > cost[h][w]+1:
            cost[h][w-1] = cost[h][w]+1
            bfs(h,w-1)
    if w+1<W:
        if s[h][w+1] == '.' and cost[h][w+1] > cost[h][w]+1:
            cost[h][w+1] = cost[h][w]+1
            bfs(h,w+1)

bfs(0,0)

if cost[-1][-1] == INF:
    print(-1)
else:
    ans = H*W-cost[-1][-1]
    for h in range(H):
        ans -= s[h].count('#')
    print(ans)

### FIXED CODE ###

import queue
H,W = map(int,input().split())
maze = [0]*H
for i in range(H):
    maze[i] = input()
inf = float('inf')
d = [[inf for i in range(W)] for i in range(H)]
dx = [1,0,-1,0]
dy = [0,1,0,-1]


def bfs():
    que = queue.Queue()
    que.put((0,0))
    d[0][0] = 0
    while que.qsize():
        p = que.get()
        if p == (H-1,W-1):
            break
        for i in range(4):
            nx = p[0]+dx[i]
            ny = p[1]+dy[i]
            if 0 <= nx and nx <= H-1 and 0 <= ny and ny <= W-1 \
            and maze[nx][ny] != '#' and d[nx][ny] == inf:
                d[nx][ny] = d[p[0]][p[1]] + 1
                que.put((nx,ny))

bfs()

count = 0
for i in range(H):
    for j in range(W):
        if maze[i][j] == '#':
            count += 1

ans = -1
if d[H-1][W-1] != inf:
    ans = H*W-count-1-d[H-1][W-1]
print(ans)
from math import ceil
h,w =map(int,input(),split())
ss = (h*(w+1)//2)
if h>1 and w>1:
  print(ss)
else:
  print(1)


### FIXED CODE ###

a,b =map(int,input().split())
ss = a*b
hf =ss//2
if a>1 and b>1:
	print(ss-hf)
else:
  print(1)
N, M = map(int, input().split())
a = []
for i in range(M):
  a.append(int(input()))
dp = []
dp.append(1)
if a:
  cantuse = a.pop(0)
  if cantuse == 1:
    dp.append(0)
  cantuse = a.pop(0)
else:
  cantuse = -1
  dp.append(1)

for i in range(N-1):
  if (i+2) == cantuse:
    dp.append(0)
    if a:
      cantuse = a.pop(0)
  else:
    dp.append(dp[-1]+dp[-2])
print(dp[-1]%1000000007)

### FIXED CODE ###

N, M = map(int, input().split())
a = []
for i in range(M):
  a.append(int(input()))
dp = []
dp.append(1)
if a:
  cantuse = a.pop(0)
  if cantuse == 1:
    dp.append(0)
    if a:
      cantuse = a.pop(0)
  else:
    dp.append(1)
else:
  cantuse = -1
  dp.append(1)

for i in range(N-1):
  if (i+2) == cantuse:
    dp.append(0)
    if a:
      cantuse = a.pop(0)
  else:
    dp.append(dp[-1]+dp[-2])
print(dp[-1]%1000000007)
a, b = int(input().split())
if a*b%2 == 0:
   print("No")
else:
  print("Yes")

### FIXED CODE ###

a,b = map(int, input().split())
if a*b%2 == 1:
  print("Yes")
else:
  print("No")
import math

r = import()

print ("%f %f" % (math.pi*r*r, math.2*pi*r))

### FIXED CODE ###

import math

r = input()

print("%f %f" % (math.pi * r ** 2, 2 * math.pi * r))
N = int(input())

for x in range(1, 3501):
    for y in range(1, 3501):
        if N*x*y/(4*x*y-N*(x+y)) == int(N*x*y/(4*x*y-N*(x+y))) and int(N*x*y/(4*x*y-N*(x+y))) > 0:
            print(x, y, int(N*x*y/(4*x*y-N*(x+y))))
            break
    else:
        continue
    break


### FIXED CODE ###

N = int(input())

for x in range(1, 3501):
    for y in range(1, 3501):
        if 4*x*y-N*(x+y) != 0:
            if N*x*y/(4*x*y-N*(x+y)) == int(N*x*y/(4*x*y-N*(x+y))) and int(N*x*y/(4*x*y-N*(x+y))) > 0:
                print(x, y, int(N*x*y/(4*x*y-N*(x+y))))
                break
    else:
        continue
    break
L, N = map(int, input())
X = []
for _ in range(N):
    X.append(int(input()))
X.sort()

Y = [L - x for x in X]
ans = 2*sum(X[:(N-1)//2+1]) + 2*sum(Y[-1:(N-1)//2:-1]) - min(X[(N-1)//2], Y[N//2])

print(ans)


### FIXED CODE ###

L, N = map(int, input().split())
X = [0]
for _ in range(N):
    X.append(int(input()))

s = [0] * (N + 1)
t = [0] * (N + 1)
for i in range(1, N + 1):
    s[i] = s[i-1] + X[i]
    t[i] = t[i-1] + (L - X[N - i + 1])
Y = [0] + [L - X[N - i] for i in range(N)]

# i >= 1


def get_d(s, x, i):
    if i == N:
        return x[N]
    a = i + (N - i) // 2
    return (
        2 * (s[a] - s[i-1] + L * (N - a) - s[N] + s[a]) -
        (x[a] if (N - i) % 2 == 0 else (L - x[a + 1]))
    )


ans = 0
for i in range(1, N + 1):
    ans = max(ans, get_d(s, X, i), get_d(t, Y, i))

print(ans)
A = int(input())
B = int(input())

if A+B = 3:
  print (3)
elif A+B=4:
  print (2)
else:
  print (1)


### FIXED CODE ###

A = int(input())
B = int(input())

if A+B == 3:
  print (3)
elif A+B == 4:
  print (2)
else:
  print (1)
f=lambda:map(int,input().split())
N,M=f()
q=[list(f()) for _ in [0]*M]
res=-1
A=range(10**(N-1),10**N)
if N==1:A+=[0]
for i in A:
    for j in range(M):
        if str(i)[q[j][0]-1]!=str(q[j][1]):
            break
    else:
        res=i
        break
print(res)

### FIXED CODE ###

f=lambda:map(int,input().split())
N,M=f()
q=[list(f()) for _ in [0]*M]
res=-1
A=list(range(10**(N-1),10**N))
if N==1:A=[0]+A
for i in A:
    for j in range(M):
        if str(i)[q[j][0]-1]!=str(q[j][1]):
            break
    else:
        res=i
        break
print(res)
x = input()
if x >= 30:
  print("Yes")
else : print("No")  

### FIXED CODE ###

x = float(input())
if x>=30.0:
    print("Yes")
else: print("No")
N=input()
A=input()
B=input()
a=int(A+B)
b=int(N/a)
c=int(N%a)
if c<A:
  print(int(b*A+c))
else:
  print(int(b*A+A))


### FIXED CODE ###

N,A,B=(int(x) for x in input().split())
a=int(A+B)
b=int(N/a)
c=int(N%a)
if c<A:
  print(int(b*A+c))
else:
  print(int(b*A+A))
from itertools import accumulate
from collections import Counter

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

A=[0]+list(accumulate(a))
res=0
for e in Counter(A).values():
	res+=e*(e-1)//2
print(res)

### FIXED CODE ###

n=int(input())
s=input()

cnt=s[1:].count('E')
ans=[cnt]

for i in range(1,n):
    if s[i-1]=='W':cnt+=1
    if s[i]=='E':cnt-=1
    ans+=[cnt]

print(min(ans))
s = input()
arr = [int(i) for i in s.split('')]
result = 0
for j in range(arr):
  result += arr[j]
if(result >= 22):
  print("bust")
else:
  print("win")

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c >= 22:
  	print("bust")
else:
  print("win")
"""
あなたは、X 円を持ってケーキとドーナツを買いに出かけました。
あなたはまずケーキ屋で 1 個 A 円のケーキを 1 個買いました。 次に、ドーナツ屋で 1 個 B 円のドーナツをできるだけたくさん買いました。
これらの買い物のあと手元に残っている金額は何円ですか。
"""

import sys

def buying_sweets(money,p_cake,p_dounuts):
    t_money  = money - p_cake
    c_dounuts = t_money // p_dounuts
    p_after_money = t_money - (c_dounuts * p_dounuts)
    return p_after_money
a = []
for line in sys.stdin:
    a.append(int(line))
money = a[1]
p_cake = a[2]
p_dounuts = a[3]
print(buying_sweets(money,p_cake,p_dounuts))


### FIXED CODE ###

"""
あなたは、X 円を持ってケーキとドーナツを買いに出かけました。
あなたはまずケーキ屋で 1 個 A 円のケーキを 1 個買いました。 次に、ドーナツ屋で 1 個 B 円のドーナツをできるだけたくさん買いました。
これらの買い物のあと手元に残っている金額は何円ですか。
"""

def buying_sweets(money,p_cake,p_dounuts):
    t_money  = money - p_cake
    c_dounuts = t_money // p_dounuts
    p_after_money = t_money - (c_dounuts * p_dounuts)
    return p_after_money

money = int(input())
p_cake = int(input())
p_dounuts = int(input())
print(buying_sweets(money,p_cake,p_dounuts))
n=int(input())
l=list(map(int,input().split()))
ans=1000000009;
for t in range(1,n+1):
  ans=min(ans,abs(sum(l[:t]) - sum(l[t:]))
print(ans)

### FIXED CODE ###

n=int(input().strip())
l=list(map(int,input().strip().split()))
ans=1000000009;
for t in range(1,n):
  ans=min(ans,abs(sum(l[:t]) - sum(l[t:])))
print(ans)