Harryxun/stf_run huggingface dataset:
N = int(input())
Alist = sorted(list(map(int, input().split())))
Blist = sorted(list(map(int, input().split())))
Clist = sorted(list(map(int, input().split())))

def binary_search1(num_list, target):
    ans_counter = 0
    if target <= num_list[0]:
        return -1
    
    if num_list[-1] < target:
        return(len(num_list))
    
    while True:

        middle = num_list[len(num_list) // 2]
        left = num_list[:len(num_list) // 2]
        right = num_list[len(num_list) // 2:]

        if target >= left[-1] and right[0] > target:
            ans_counter += len(left)
            return ans_counter

        elif target < left[-1]:
            num_list = left
    
        elif right[0] <= target:
            ans_counter += len(left)
            num_list = right

def binary_search2(num_list, target):
    ans_counter = 0
    if target <= num_list[0]:
        return -1
    
    if num_list[-1] < target:
        return(len(num_list))
    
    while True:

        middle = num_list[len(num_list) // 2]
        left = num_list[:len(num_list) // 2]
        right = num_list[len(num_list) // 2:]

        if target > left[-1] and right[0] >= target:
            ans_counter += len(left)
            return ans_counter

        elif target <= left[-1]:
            num_list = left
    
        elif right[0] < target:
            ans_counter += len(left)
            num_list = right

ans = 0
#for C in Clist:
#    b_point = 0
#    b_point =  binary_search(Blist, C)

#    if b_point >= 0:
#        for B in Blist[:b_point]:
#            a_point =  binary_search(Alist, B)
#            print(B,C,a_point) 
#            ans += (a_point)

for B in Blist:
    a_point = binary_search2(Alist, B)
    c_point = binary_search1(Clist, B)
#    print(B,a_point, c_point, Clist.count(B))

    ans = ans + a_point * (N - c_point)

print(ans)
#for C in Clist:
    

### FIXED CODE ###

import bisect

N = int(input())
Alist = sorted(list(map(int, input().split())))
Blist = sorted(list(map(int, input().split())))
Clist = sorted(list(map(int, input().split())))

ans = 0

for B in Blist:
    Aindex = bisect.bisect_left(Alist, B)
    Cindex = bisect.bisect_right(Clist, B)

#    print(B, Aindex, N-Cindex)
    ans += Aindex * (N - Cindex)

print(ans)
N = int(raw_input())
a = raw_input()
aa = a.split(" ")
aaa = []
for i in range(len(aa)):
	aaa.append((i+1,int(aa[i])))

ctr = 0

for (a,b) in aaa:
	if (b,a) in aaa:
		ctr = ctr + 1

ctr = ctr / 2
print(str(ctr))

### FIXED CODE ###

s = raw_input()
s2 = s[:4] + " " + s[4:]
print(s2)
S,T = str(open(0))
Snum = len(S)

if S == T[:-1]:
  print("Yes")
  
else:
  primt("No")


### FIXED CODE ###

S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")
a, b = (map(int, input().split(' ')))

if sum(num) < 2 or 6 < sum(num):
    raise ValueError('Input value is more than 1 and less than 3.')

print('Yes' if (a * b) % 2 == 1 else "No")


### FIXED CODE ###

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

if a + b < 2 or 6 < a + b:
    raise ValueError('Input value is more than 1 and less than 3.')

print('Yes' if (a * b) % 2 == 1 else "No")
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from math import sqrt

while True:
    e = int(input())
    if e == 0:
        break
    ans = 10**9
    for z in range(e):
        if z > e:
            break
        y = int(sqrt(e-z**3))
        x = e - y ** 2 - z ** 3
        ans = min(ans,x+y+i)
    print(ans)

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from math import sqrt

while True:
    e = int(input())
    if e == 0:
        break
    ans = 10**9
    for z in range(e):
        if z**3 > e:
            break
        y = int(sqrt(e-z**3))
        x = e - y ** 2 - z ** 3
        ans = min(ans,x+y+z)
    print(ans)
yandy
K, S = map(int, input().split())

ans = 0
for z in range(K+1):
    for y in range(K+1):
        if 0 <= S - z - y <= K:
            ans += 1

print(ans)


### FIXED CODE ###

k,s=map(int,input().split())
count=0
for a in range(k+1):
  for b in range(k+1):
    if 0<=s-a-b<=k:
      count+=1
print(count)
a=int(input())
s=str(input())
if a=>3200:
  print(s)
else:
  print("red")

### FIXED CODE ###

a=int(input())
s=str(input())
if a>=3200:
  print(s)
else:
  print("red")
N=int(input())
suji=input()
I1=suji.split(" ")
I=list(map(int,I1))
wari=2
n=0
kazu=0

while n<N:
    if n!=N-1:
        if I[n]%2==0:
            n+=1
    if  n==N-1:
        if I[N-1]%2==0:
            wari=wari*2
            kazu=kazu+1
            n=0
    else:
        X=0
        break
print(kazu)

### FIXED CODE ###

I=input()
I2=map(int, I)
X=sum(I2)
print(X)
import bisect

N = int(input())
A = [0] * N
for i in range(N):
  A[i] = int(input())

B = [A[0]]
for i in range(1, N):
  print(B)
  if A[i] <= B[0]:
    B.insert(0, A[i])
  else:
    index = bisect.bisect_left(B, A[i]) - 1
    B[index] = A[i]
print(len(B))

### FIXED CODE ###

import bisect

N = int(input())
A = [0] * N
for i in range(N):
  A[i] = int(input())

B = [A[N - 1]]
for i in reversed(range(0, N - 1)):
  if A[i] >= B[-1]:
    B.append(A[i])
  else:
    index = bisect.bisect_right(B, A[i])
    B[index] = A[i]
print(len(B))
a, b = map(int,input().split())

if( (a+b) >= 10):
    print("error")
else:
    print(A+B)

### FIXED CODE ###

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

if( (a+b) >= 10):
    print("error")
else:
    print(a+b)
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 998244353
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

K,N = inpl()

MAX = 1000*3
fac = [1]*(MAX+1)
for i in range(1,MAX+1):
	fac[i] = (fac[i-1]*i)%mod

gyakugen = [1]*(MAX+1)
gyakugen[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
	gyakugen[i-1] = (gyakugen[i]*i)%mod

def Comb(n,k):#nCk
	return (fac[n]*gyakugen[k]*gyakugen[n-k])%mod

#K=k,N=n,0pair = 0
def calc(k,n,i):
	x = (i-2)//2
	k -= x
	n -= x
	if k == 1:
		if n <= 1:
			return n
		else:
			return 0
	tmp = 0
	for j in range(2):
		zb = n-j
		zm = k-2
		tmp += Comb(zb+zm,zb)%mod
	tmp %= mod
	tmp *= (2**x)%mod
	return tmp

ans = []
for i in range(2,K+2):
	if i%2 == 0:
		pairs = (i-2)//2
		tmp = 0
		for p0 in range(pairs+1):
			tmp += calc(K-p0*2,N,i-p0*2)*Comb(pairs,p0)%mod
			tmp %= mod
	ans.append(tmp)
	print(tmp)

ans = ans[::-1]

for i in range(1,K):
	print(ans[i])


### FIXED CODE ###

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 998244353
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

K,N = inpl()
MAX = K+N+10
fac = [1]*(MAX+1)
for i in range(1,MAX+1):
	fac[i] = (fac[i-1]*i)%mod

gyakugen = [1]*(MAX+1)
gyakugen[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
	gyakugen[i-1] = (gyakugen[i]*i)%mod

def Comb(n,k):#nCk
	return (fac[n]*gyakugen[k]*gyakugen[n-k])%mod

#K=k,N=n,0pair = 0
def calc(k,n,i):
	x = (i-2)//2
	k -= x
	n -= x
	if k == 1:
		if n <= 1:
			return n
		else:
			return 0
	elif n == 0:
		return pow(2,x,mod)
	elif n < 0 or k <= 0:
		return 0

	tmp = 0
	for j in range(2):
		zb = n-j
		zm = k-2
		tmp += Comb(zb+zm,zb)%mod
	tmp %= mod
	tmp *= pow(2,x,mod)
	return tmp

ans = []
for i in range(2,K+2):
	if i%2 == 0:
		pairs = (i-2)//2
		tmp = 0
		for p0 in range(pairs+1):
			tmp += calc(K-p0*2,N,i-p0*2)*Comb(pairs,p0)%mod
			tmp %= mod
	ans.append(tmp)
	print(tmp)

ans = ans[::-1]
for i in range(1,K):
	print(ans[i])
from fractions import gcd
N,K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
g = A[0]
for i in range(1, N):
    g = gcd(g, A[i])
print('POSSIBLE' if (K <= A[-1] and K % gcd_all() == 0) else 'IMPOSSIBLE')


### FIXED CODE ###

from fractions import gcd

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

def gcd_all():
    x = A[0]
    for i in range(1, N):
        x = gcd(x, A[i])
    return x

def solve():
    if K > A[-1]:
        return False
    return K % gcd_all() == 0

print('POSSIBLE' if solve() else 'IMPOSSIBLE')
a,b,k=map(int,input().split())
if a-k>=0:
    print(a-k,b)
elif a+b>=k:
    print(0,a+b-k)
else:
    print(0,0z)


### FIXED CODE ###

a,b,k=map(int,input().split())
if a-k>=0:
    print(a-k,b)
elif a+b>=k:
    print(0,a+b-k)
else:
    print(0,0)
L,R=map(int,input().split())
a=[]
if R-L>=2019:
	print(0)
else:
	for i in range(L,R+1):
		for j in range(i+1,R+1):
			a.append(((i%2019)*(j%2019))%2019)
 
	print(min(a))

### FIXED CODE ###

N,A,B=map(int,input().split())
if N*A<=B:
	print(N*A)
else:
	print(B)
n = int(input())
lst = [input() for _ in range(n)]
lstset = set(lst)

if len(lst) != len(lstset):
    print("No")
else:
    cnt = 0
    for i in range(n-1):
        if lst[i][-1] == lst[i + 1][0]:
            cnt += 1
        else:
            break
    if cnt + 1 == len(lst):
        print('Yes')
    else:

### FIXED CODE ###

n = int(input())
lst = [input() for _ in range(n)]
lstset = set(lst)

if len(lst) != len(lstset):
    print("No")
else:
    cnt = 0
    for i in range(n-1):
        if lst[i][-1] == lst[i + 1][0]:
            cnt += 1
        else:
            break
    if cnt + 1 == len(lst):
        print('Yes')
    else:
        print('No')
import numpy as np

N = int(input())
T = np.array([int(input()) for _ in range(N)])


print(np.lcm.reduce(T))
# for i in range(1,N):



### FIXED CODE ###

import fractions
n=int(input())
ans=int(input())
for i in range(n-1):
  t=int(input())
  ans=(ans*t)//fractions.gcd(t,ans)
print(ans)
import math
from functools import reduce
n=int(input())
lst=list(map(int,input().split()))
count=0
def gcd(*numbers):
    return reduce(math.gcd, numbers)
result = gcd(*lst)
while 1:
    if result%2 == 0:
        count += 1
        result //= 2
    else:
        break
print(count)

### FIXED CODE ###

n=int(input())
lst=list(map(int,input().split()))
count=0
def check(lst):
    for i in lst:
        if i%2 != 0:
            return False
    return True
def two_devision(lst):
    new_lst=[]
    for i in lst:
        new_lst.append(i//2)
    return new_lst
while check(lst):
    lst=two_devision(lst)
    count += 1
print(count)
import math
def solution():
    a, b, h, m  = map(int, input().split())
    return (a*a+b*b-2*a*b*cos((m*11/360-h/6)*pi))**.5
print(solution())


### FIXED CODE ###

from math import *
def solution():
    a, b, h, m  = map(int, input().split())
    return (a*a+b*b-2*a*b*cos((m*11/360-h/6)*pi))**.5
print(solution())
A = int(input())
B = int(input())
C = int(input())
X = int(input())

counter = 0
for a in range(A + 1):
  for b in range(B + 1):
    for c in range(C + 1):
      if X == a * 500 + b * 100 + c * 50:
        counter += 1
print(counter)

### FIXED CODE ###

x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)
N, K = map(int, input().split())
S = str(input())
S[K] = S[K].lower()

### FIXED CODE ###

N, K = map(int, input().split())
S = str(input())
ans = ""
for i in range(N):
  if i == K-1:
    ans += S[i].lower()
  else:
    ans += S[i]
print(ans)
# coding: utf-8
import math
from collections import deque
n = int(input())
#x, y = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
B = deque()
if n%2==0:
    for i in range(n):
        a=str(A[i])
        if i%2==1:
            B.appendleft(a)
        else:
            B.append(a)
if n%2==1:
    for i in range(n):
        if i%2==0:
            B.appendleft(a)
        else:
            B.append(a)
print(' '.join(B))

### FIXED CODE ###

# coding: utf-8
n=int(input())
A=list(map(int,input().split()))
B=[0]*n
l=n//2
if n%2==0:
    for i in range(n):
        if i%2==0:
            B[l+i]=str(A[i])
            l=l+i
        else:
            B[l-i]=str(A[i])
            l=l-i
else:
    for i in range(n):
        if i%2==0:
            B[l-i]=str(A[i])
            l=l-i
        else:
            B[l+i]=str(A[i])
            l=l+i
print(' '.join(B))
s=input()

print(s[::(s.len()-8)])

### FIXED CODE ###

s=input()

print(s[:(len(s)-8)])
= input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print("Yes")
else:
    print("No")
def kai():
    N=int(input())
    A=list(map(int,input().split()))
    
    if  0 in A:
        print(0)
        return
    
    ans=1
    for i in A:
        ans*=i
        if ans>10**18:
            print(-1)
            rerurn
    print(ans)
    return
kai()

### FIXED CODE ###

A,B=map(int,input().split())
print(A*B)
s=list(map(int,input()))
a=10*s[0]+s[1]
b=10*s[2]+s[3]
if a<=12 and b<=12:
    print('AMBIGUOUS')
elif a+b==0:
    print('NA')
elif a>12 and b>12:
    print('NA')
elif a==0,b>12:
    print('NA')
elif b==0.a>12:
    print('NA')
elif 0<a<=12 and 12<b:
    print('MMYY')
elif 0<b<=12 and 12<a:
    print('YYMM')
elif 0<a<=12 and 0==b:
    print('MMYY')
elif 0<b<=12 and 1==a:
    print('YYMM')


### FIXED CODE ###

s=list(map(int,input()))
a=10*s[0]+s[1]
b=10*s[2]+s[3]
counta=0
countb=0
'''month'''
if 0<a<=12:
    counta+=1
if 0<b<=12:
    countb+=1
'''year'''
if a==0 or a>=13:
    counta+=5
if b==0 or b>=13:
    countb+=5
j=counta+countb
if j==2:
    print('AMBIGUOUS')
elif j==6 and counta==5:
    print('YYMM')
elif j==6 and countb==5:
    print('MMYY')
else:
    print('NA')
n = int(input())
mod = 10**9+7
a = np.array(list(map(int,input().split())))
ans = 0
for i in range(60):
    #aをiビット右にずらす、iは60桁目まで、&1で対象のビットが1のもの以外を0にその数をカウントする。
    b = np.count_nonzero(a >>i&1)
    ans += ((2**i)*(n-b)*b)%mod
print(ans)

### FIXED CODE ###

import numpy as np
n = int(input())
mod = 10**9+7
a = np.array(list(map(int,input().split())))
ans = 0
for i in range(60):
    #aをiビット右にずらす、iは60桁目まで、&1で対象のビットが1のもの以外を0にその数をカウントする。
    b = np.count_nonzero(a >>i&1)
    ans += ((2**i)*(n-b)*b)%mod
print(ans%mod)
n,a,b,k=map(int,input().split())
mod=998244353
ans=0
p=[1]*(n+1)
for i in range(n):
    p[i+1]=((i+1)*p[i])%mod
for ai in range(n+1):
    if k-a*ai>=0 and (k-a*ai)%b==0:
        bi=(k-a*ai)//b
        ans+=p[n]*pow(p[ai],mod-2,mod)*pow(p[n-ai],mod-2,mod)
        ans%=mod
        ans+=p[n]*pow(p[bi],mod-2,mod)*pow(p[n-bi],mod-2,mod)
        ans%=mod
print(ans)

### FIXED CODE ###

n,a,b,k=map(int,input().split())
mod=998244353
ans=0
p=[1]*(n+1)
for i in range(n):
    p[i+1]=((i+1)*p[i])%mod
for ai in range(n+1):
    if k-a*ai>=0 and (k-a*ai)%b==0:
        bi=(k-a*ai)//b
        if bi<=n:
            ans+=p[n]*pow(p[ai],mod-2,mod)*pow(p[n-ai],mod-2,mod)*p[n]*pow(p[bi],mod-2,mod)*pow(p[n-bi],mod-2,mod)
            ans%=mod
print(ans)
n,l=map(int,input().split())
list=sorted([input() for i in range(n)])
print(*list,sep="")

### FIXED CODE ###

a,b,c=sorted(map(int,input().split()))
print("YES" if a==b==5 and c==7 else "NO")
sum=0
for i in range(5):
  y=int(input())
  x=y%10
  if x==0:
    sum+=y
  else:
    min=min(x, 9)
    if x==min:
      sum+=y
    else:
      sum+=y+10-x
print(sum)

### FIXED CODE ###

X=[int(input()) for i in range(5)]
Y=[]
for x in X:
  Y.append(-(-x//10)*10-x)
print(sum(X)+sum(Y)-(max(Y)))
N,M = list(map(int, input().split()))
cakes = []
for i in range(N):
    cakes.append(list(map(int, input().split())))

ans = 0

values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(x+y+z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))

values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(x+y-z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))


values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(x-y+z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))


values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(x-y-z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))


values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(-x+y+z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))


values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(-x+y-z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))



values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(-x-y+z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))


values = []
for cake in cakes:
    value = 0
    for j in range(3):
        values.append(-x-y-z)
values.sort()
values = values[::-1]
ans = max(ans, sum(values[:M]))


print(ans)
    

### FIXED CODE ###

N,M = list(map(int, input().split()))
cakes = []
for i in range(N):
    cakes.append(list(map(int, input().split())))

ans = 0

for i in range(8):
    values = []
    for cake in cakes:
        value = 0
        for j in range(3):
            if (i >> j) % 2 == 1:
                value -= cake[j]
            else:
                value += cake[j]
        values.append(value)
    values.sort()
    values = values[::-1]
    ans = max(ans, sum(values[:M]))

print(ans)
import sys

import numpy as np

readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(" ")]


n = readInt()
M = 10 ** 9 + 7


dp = np.zeros((n + 1, 256), dtype=np.uint32)
dp[0, 255] = 1


for i in range(n):
    for j4 in [0, 64, 128, 192]:
        for j3 in [0, 16, 32, 48]:
            j43 = j4 + j3
            for j2 in [0, 4, 8, 12]:
                j432 = j43 + j2
                for j1 in range(4):
                    j = j432 + j1
                    l321 = 4 * (j3 + j2 + j1)
                    for l0 in range(4):
                        if (6 == (j3 + 4 * j1 + l0)) or (6 == (j3 + j2 + l0)) or (6 == (4 * j2 + 4 * j1 + l0)) or (6 == (16 * j1 + j2 + l0)) or (6 == (4 * j2 + 4 * l0 + j1)):
                            continue
                        l = l321  + l0
                        dp[i + 1, l] = (dp[i + 1, l] + dp[i, j]) % M

ret = 0
for v in dp[-1]:
    ret = (ret + v) % M
print(ret)

### FIXED CODE ###

import sys

b = sys.stdin.readline().strip()
r = {"A": "T", "T": "A", "C": "G", "G": "C"}[b]
print(r)
import sys
sys.stdin.readline() 

n = int(input())
arr = list(map(int,input().split()))
count = 0
minimum = arr[0]
for num in arr:
  if num <= minimum:
    minimum = num
    count += 1
print(count)

### FIXED CODE ###

txt = input().split(' ')
if txt[0] == txt[1]:
  print('Yes')
else:
  print('No')
N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
# dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	if n == 0:
		dp[n] = 0
		return dp[n]
	ans = 0
	for i in L:
		if fn(n-i) == 0:
			ans = 1
			break
	dp[n] = ans		
	return dp[n]
for l in range(1, 	K):
	fn(l)
if fn(K):
	print("First")
else:
	print("Second")

### FIXED CODE ###

N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
# dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	if n == 0:
		dp[n] = 0
		return dp[n]
	ans = 0
	for i in L:
		if n >= i:
			if fn(n-i) == 0:
				ans = 1
				break
	dp[n] = ans		
	return dp[n]
for l in range(K):
	fn(l)
if fn(K) == 1:
	print("First")
else:
	print("Second")
n,k=list(map(int,input().split()))
a=[0]+ list(map(int,input().split()))

visited=[1]

for i in range(n):
  next=a[visited[-1]]
  if next in visited:
    loop_end=n+1
    loop_start=visited.index(n)
    period=loop_end-loop_start
  visited.append(next)
#print(visited) 
#print(period)
if k<n+1:
  print(visited[k])
  exit()
else:
  print(visited[k%period])

### FIXED CODE ###

n,k=list(map(int,input().split()))
a=[0]+ list(map(int,input().split()))

visited=[1]

for i in range(n):
  next=a[visited[-1]]
  visited.append(next)
  
loop_end=n
loop_start=n-1
while visited[loop_start]!=visited[loop_end]:
  loop_start-=1
period=loop_end-loop_start
#print(visited) 
#print("p:",period)
#print("(k-n)%period:",(k-n)%period)

if k<n+1:
  print(visited[k])
  exit()
else:
  print(visited[n-period+(k-n)%period])
N, C = list(map(int, input().split()))
len_cal_list = [list(map(int, input().split())) for i in range(N)]

total_cal = 0
f_r = [0]
for l, c in len_cal_list:
    total_cal += c
    f_r.append(total_cal - l)

total_cal = 0
f_l = [0]
for l, c in len_cal_list[::-1]:
    total_cal += c
    f_l.append(total_cal - (C - l))


max_cal = 0
for i in range(N):
	tmp_cal_r = f_r[i] + max(max(f_l[:N-i+1]) - len_cal_list[i-1][0], 0)
	tmp_cal_l = f_l[i] + max(max(f_r[:N-i+1]) - (C - len_cal_list[-i][0]), 0)
	if max_cal <= max(tmp_cal_r, tmp_cal_l):
		max_cal = max(tmp_cal_r, tmp_cal_l)

print(max_cal)

### FIXED CODE ###

S = input()
count = 0
for i in range(3):
	if S[i] == 'o':
		count += 1

print(700 + 100*count)
N = int(input())
A = list(map(int, input().split()))
for i in N:
	abs=abs(A-)

D,X =  map(int, input().split())
N_chocolate=0
for i in range (N):
	A= int(input())
	if A == 1:
		N_chocolate=N_chocolate+D-1
	else:
		N_chocolate=N_chocolate+int(D/A)
output=N_chocolate+X+N
print (output)

### FIXED CODE ###

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

A_before=0
full_price=0
for i in range (N):
    full_price=full_price+abs(A[i]-A_before)
    A_before=A[i]
full_price=full_price+abs(A[N-1])

total_price=0
#No.1
negative=abs(A[0]-0)+ abs(A[1]-A[0])-abs(A[1]-(0))
total_price=full_price-negative
print(total_price)

for j in range (1,N-1):
    negative=abs(A[j]-A[j-1])+ abs(A[j+1]-A[j])-abs(A[j+1]-(A[j-1]))
    total_price=full_price-negative
    print(total_price)
    
#No.Last
negative=abs(0-A[N-1])+ abs(A[N-1]-A[N-2])-abs(0-A[N-2]) 
total_price=full_price-negative
print(total_price)
M,N,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

res = 0
time = 0

while time <= K:
    if A[0] <= B[0]:
        time = time + A.pop(0)
    else:
        time = time + B.pop(0)
    res += 1

print(res)

### FIXED CODE ###

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

a, b = [0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i+j)
print(ans)
N = int(input())
A = [int(i) for i in input().split()]

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

if N == 2:
    print(max(A))

else:
    if gcd(A[0], A[1]) > gcd(A[1], A[2]):
        x = 2
    elif gcd(A[0], A[1]) < gcd(A[1], A[2]):
        x = 0
    elif gcd(A[0], A[2]) > gcd(A[1], A[2]):
        x = 1
    elif gcd(A[0], A[2]) < gcd(A[1], A[2]):
        x = 0
    else:
        A2 = A.copy()
        for i in range(2, N - 1):
            A2[i + 1] = gcd(A2[i], A2[i + 1])
            if A2[i] > A2[i + 1]:
                x = i + 1
                break

    del A[x]
    for i in range(N - 2):
        A[i + 1] = gcd(A[i], A[i + 1])
    print(A[-1])

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]

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

B = A.copy()
for i in range(N - 1):
    B[i + 1] = gcd(B[i], B[i + 1])

C = A.copy()
C.reverse()
for i in range(N - 1):
    C[i + 1] = gcd(C[i], C[i + 1])
C.reverse()

ans = 0
for i in range(N):
    if i == 0:
        tmp = C[i + 1]
    elif i == N - 1:
        tmp = B[i - 1]
    else:
        tmp = gcd(B[i - 1], C[i + 1])
    ans = max(ans, tmp)
    
print(ans)
N, M = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse = True)

n = 0
if N > 1:
    while not M == 0:

        while A[0] >= A[1]:
            A[n] //= 2
            M -= 1
            if M == 0:
                break
        i = 0
        while A[i] < A[i+1]:
            A[i], A[i+1] = A[i+1], A[i]
            i += 1

        if M == 0:
            break

else:
    A[0] //= (2**M)


result = sum(A)
print(result)


### FIXED CODE ###

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

for i in range(len(A)):
    A[i] *= -1

import heapq

heapq.heapify(A)


for _ in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, ((a*(-1))//2)*(-1))


result = -sum(A)
print(result)