Harryxun/stf_run huggingface dataset:
import fractions

n = int(input())
t = [0] * n
for i in range(n):
    t[i] = int(input())

ans = t[0]
for i in range(1,n):
    ans = ans * a[i] // fractions.gcd(ans,a[i])
print(ans)


### FIXED CODE ###

import fractions

n = int(input())
t = [0] * n
for i in range(n):
    t[i] = int(input())

ans = t[0]
for i in range(1,n):
    ans = ans * t[i] // fractions.gcd(ans,t[i])
print(ans)
n = int(input())
f = float('inf')
for a in range(1, int(n**0.5)):
    if n % a == 0:
        b = n // a
        x = max(len(str(a)), len(str(b)))
        if f > x:
            f = x
print(x)

### FIXED CODE ###

n = int(input())
f = float('inf')
for a in range(1, int(n**0.5)+1):
    if n % a == 0:
        b = n // a
        x = max(len(str(a)), len(str(b)))
        if f > x:
            f = x
print(x)
N = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
dis = 0
for i in range(N-1):
  dis = ((x[0])**2+(y[0])**2)**0.5
  dis += ((x[i]-x[i+1])**2+(y[i]-y[i+1])**2)**0.5
print(dis/N)

### FIXED CODE ###

N = int(input())
XY = [[0]*2]*N
dis = 0
for i in range(N):
  XY[i] = [int(_) for _ in input().split()]
for i in range(N):
  Xi = XY[i][0]
  Yi = XY[i][1]
  for j in range(N):
    Xj = XY[j][0]
    Yj = XY[j][1]
    dis += ((Xi-Xj)**2 + (Yi-Yj)**2)**0.5

print(dis/N)
a,b=map(int,input().split())
if a%2==0:print("Even")
  elif b%2==0:print("Even")
    else print("Odd")

### FIXED CODE ###

a,b=map(int,input().split())
if (a)%2 == 0:
  print("Even")
elif (b)%2 == 0:
	print("Even")
else:
  print("Odd")
import sys
s = input() + chr(96)

if len(s) != 26:
    sets = set(s)
    for i in range(ord('a'), ord('z') + 1):
        if chr(i) not in sets:
            print(s[:j] + chr(i))
            sys.exit(0)
j = 26
for j in range(26, 1, -1):
    if s[j - 1] > s[j]:
        continue
    sets = set(list(s[:j]))
    for i in range(ord(s[j]) + 1, ord('z') + 1):
        if chr(i) not in sets:
            print(s[:j] + chr(i))
            sys.exit(0)
print(-1)

### FIXED CODE ###

import sys
s = input() + chr(96)

for j in range(len(s) - 1, -1, -1):
    sets = set(list(s[:j]))
    for i in range(ord(s[j]) + 1, ord('z') + 1):
        if chr(i) not in sets:
            print(s[:j] + chr(i))
            sys.exit(0)
print(-1)
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    l, r, d = map(int, input().split())
    l, r = l - 1, r - 1
    G[l].append((r, d))
    G[r].append((l, -d))
used = [False] * N
dist = [0] * N
flag = False


def dfs(v, d0):
    global flag
    if used[v]:
        if dist[v] != d0:
            flag = True
        return
    else:
        used[v] = True
        dist[v] = d0

        for w, d1 in G[v]:
            dfs(w, d0 + d1)


for i in range(N):
    if not used[i]:
        dfs(i, 0)

if flag:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(200002)
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    l, r, q = map(int, input().split())
    G[l - 1].append((r - 1, q))
    G[r - 1].append((l - 1, -q))
X = [None] * N


def dfs(u):
    global X, G
    for w, d in G[u]:
        if X[w] is None:
            X[w] = X[u] + d
            if not dfs(w):
                return False
        else:
            if X[w] != X[u] + d:
                return False

    return True


flag = True
for i in range(N):
    if X[i] is None:
        X[i] = 0
        flag &= dfs(i)

if flag:
    print("Yes")
else:
    print("No")
N,M = map(int,input().split())
List = list(map(int,input().split()))

a = [0,2,5,5,4,5,6,3,7,6]

kazu = [a[List[i]] for i in range(M)]

def dddd(kazu,X):
  dp = [ [ 0 for j in range(X+1)]  for i in range(M)]

  for i in range(M):
    for j in range(X):
      if kazu[i] <= j:
        dp[i][j+1] = max(dp[i][j+1-kazu[i]] + 1,dp[i-1][j+1])
      else:
        dp[i][j+1] = dp[i-1][j+1]
  return dp[-1]
   
keta_arr = dddd(kazu,N)
keta = keta_arr[-1]
List.sort(reverse=True)
ans = []
x = 0

for i in range(keta):
  for aa in List:
    k = a[aa]
    if N-k > 0:
      if keta_arr[-k-1-x] == keta-i-1 and keta-i-1 != 0:
        ans.append(aa)
        x += k
        N = N-k
        if N == 0:
          break
        continue
    elif N == k and keta-i-1 == 0:
      ans.append(aa)
      N = 0
  if N == 0:
    break
ans.sort(reverse=True)
print(int(''.join(map(str,ans))))

### FIXED CODE ###

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

a = [0,2,5,5,4,5,6,3,7,6]

kazu = [a[List[i]] for i in range(M)]

def dddd(kazu,X):
  dp = [ [ -float('inf') for j in range(X+1)]  for i in range(M)]
  for i in range(M):
    dp[i][0] = 0

  for i in range(M):
    for j in range(X+1):
      if kazu[i] <= j:
        dp[i][j] = max(dp[i][j-kazu[i]] + 1,dp[i-1][j])
      else:
        dp[i][j] = dp[i-1][j]
  return dp[-1]
   
keta_arr = dddd(kazu,N)
keta = keta_arr[-1]
List.sort(reverse=True)
ans = []

while keta>0:
  for aa in List:
    k = a[aa]
    if N-k < 0:
      continue
    if N-k >= 0:
      if keta_arr[N-k] == keta-1:       
        ans.append(aa)
        N = N-k
        keta -= 1
        break
ans.sort(reverse=True)
print(int(''.join(map(str,ans))))
n,a = map(int,input())
if n%a == 0:
  print(n//a)
else:
  print(n//a +1)

### FIXED CODE ###

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

ans = 0

while h > 0:
    ans += 1
    h -= a

print(ans)
read r
echo $((3**r*r))


### FIXED CODE ###

r = int(input())
print(3*r**2)
import math

n = int(input())
k = int(input())
xs = [int(input()) for i in range(n)]

print(2*sum([min([x, k - x]) for x in xs]))

### FIXED CODE ###

import math

n = int(input())
k = int(input())
xs = list(map(int, input().strip().split()))

print(2*sum([min([x, k - x]) for x in xs]))
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i < 10:
        k += 1
    if 100 =< i < 1000:
        k += 1
    if 10000 =< i < 100000:
        k += 1
print(k)


### FIXED CODE ###

N = int(input())
k = 0
for i in range(1, N+1):
    if 1 <= i <= 9:
        k += 1
    elif 100 <= i <= 999:
        k += 1
    elif 10000 <= i <= 99999:
        k += 1
print(k)
print(int(input() ** 3))

### FIXED CODE ###

x = int(input())
print(x**3)
import sys
s = str(input())
i = 0
while i < len(s):
    if i + 5 <= len(s) and s[i:i+5] == 'dream': #now dream or dreamer
        if i + 6 < len(s) and s[i+5] == 'e' and s[i+6] == 'r': #now dreamer or now dream and next is erase or eraser
            if s[i+7] == 'a': #next erase or eraser, now dream
                i += 5
            else: #now dreamer
                i += 7
        else: #now dream
            i += 5
    elif i + 5 <= len(s) and s[i:i+5] == 'erase':
        if i + 5 < len(s) and s[i+5] == 'r': #now eraser
            i += 6
        else: #now erase
            i += 5
    else:
        print('NO')
        sys.exit()
print('YES')


### FIXED CODE ###

import sys
s = str(input())
i = 0
while i < len(s):
    if i + 5 <= len(s) and s[i:i+5] == 'dream': #now dream or dreamer
        if i + 6 < len(s) and s[i+5] == 'e' and s[i+6] == 'r': #now dreamer or now dream and next is erase or eraser
            if i + 7 < len(s) and s[i+7] == 'a': #next erase or eraser, now dream
                i += 5
            else: #now dreamer
                i += 7
        else: #now dream
            i += 5
    elif i + 5 <= len(s) and s[i:i+5] == 'erase':
        if i + 5 < len(s) and s[i+5] == 'r': #now eraser
            i += 6
        else: #now erase
            i += 5
    else:
        print('NO')
        sys.exit()
print('YES')
n,k = map(int,input().split())
ls = list(map(int,input().split()))
i = 1
di = [-1]*10
di[0] = 0
while True:
    if i == 1:
        a = ls[0]
        di[a-1] = i
        i += 1
        continue
    if i == k+1:
        print(a)
        break
    a = ls[a-1]
    if di[a-1] != -1:
        p = (k+1-di[a-1])%(i-di[a-1])
        s = i-di[a-1]
        if p ==0:
            q = di.index(i-1)+1
            print(q)
        else:
            q = di.index(i-s-1+p)+1
            print(q)
        break
    di[a-1] = i
    i += 1

### FIXED CODE ###

n,k = map(int,input().split())
ls = list(map(int,input().split()))
fi = [-1]*(n+1)
fi[1] = 0
a = 0
aa = 0
for i in range(k):
    if fi[ls[a]] == -1:
        fi[ls[a]] = i + 1
        aa = a
        a = ls[a] - 1
    else:
        ind = fi[ls[a]]
        t = (k - ind) % (max(fi) + 1 - ind)
        t += ind
        print(fi.index(t))
        break
else:
    print(ls[aa])
a = int(input())
b = int(input())
print(a * b)
print(a*2 + b*2)

### FIXED CODE ###

a = input().split()
men = int(a[0]) * int(a[1])
shu = int(a[0]) * 2 + int(a[1]) * 2
print('{0} {1}'.format(men,shu))
n,m = map(int,input().split())
a = list(map(int,input().split()))
lis = [1] + [0]*n

for i in a:
  lis[i]=-1
lis[1] += 1
for i in range(n-1):
  if lis[i+2]==-1:
    lis[i+2]= 0
  else:
    lis[i+2] = lis[i+1] + lis[i]
print(lis[n]%1000000007)

### FIXED CODE ###

n,m = map(int,input().split())
a = [ int(input()) for _ in range(m)]
M=10**9+7
lis = [1] + [0]*n

for i in a:
  lis[i]=-1
lis[1] += 1
for i in range(n-1):
  if lis[i+2]<0:
    lis[i+2]= 0
  else:
    lis[i+2] = (lis[i+1] + lis[i])%M
print(lis[n])
a,b=map(int,input().split())
count=1
for i in range(1,100):
    if a/(b**i)>=1:
        count+=1
    else:
        break
print(count)

### FIXED CODE ###

N,R=map(int,input().split())
if N>= 10:
  print(R)
else:
  print(R+(100*(10-N)))
i = int(input())
s = input()
ans = 0

for x in range(len(i)) :
    if s[x] == "I" :
        ans += 1
    else :
        ans -= 1

print(ans)

### FIXED CODE ###

a,b,c,d = map(int, input().split())
if a*b >= c*d :
    print(a*b)
else :
    print(c*d)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

MOD = 10**9+7

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

if S[0] == "W" or S[-2] == "W":
    print(0)
    sys.exit()

LR = [0]
for i in range(1, 2*N):
    if LR[i-1] == 0:
        if S[i] == S[i-1]:
            LR.append(1)
        else:
            LR.append(0)
    else:
        if S[i] == S[i-1]:
            LR.append(0)
        else:
            LR.append(1)

if LR.count(0) != N:
    print(0)
    sys.exit()

count0 = 0
ans = 1
for i in range(2*N):
    if LR[i] == 0:
        count0 += 1
    else:
        ans *= count0
        count0 -= 1

def factorial(N, mod):
    if N == 0 or N == 1:
        return 1
    else:
        return N * factorial(N, mod) % mod

print(ans*factorial(N,MOD)%MOD)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

MOD = 10**9+7

N = int(input())
S = list(input().rstrip())

if S[0] == "W" or S[-1] == "W":
    print(0)
    sys.exit()

LR = [0 for i in range(2*N)]
count0 = 1
count0_raw = 1
ans = 1
for i in range(1, 2*N):
    if LR[i-1] == 0:
        if S[i] == S[i-1]:
            LR[i] = 1
        else:
            LR[i] = 0
    else:
        if S[i] == S[i-1]:
            LR[i] = 0
        else:
            LR[i] = 1

    if LR[i] == 0:
        count0 += 1
        count0_raw += 1
    else:
        ans *= count0
        ans %= MOD
        count0 -= 1

if count0_raw != N:
    print(0)
    sys.exit()

N_k = 1
for i in range(N):
    N_k *= i+1
    N_k %= MOD

print(ans*N_k%MOD)
import sys
sys.setrecursionlimit(10 ** 9)

n = int(input())
tree = [[] for _ in range(n)]
dic = {}

for i in range(n - 1):
    a, b = map(int, input().split())
    tree[a - 1].append(b - 1)
    tree[b - 1].append(a - 1)
    dic[(a - 1, b - 1)] = i
ans = [0 for _ in range(n - 1)]
max_color = 0

def dfs(pos, before_pos, before_color):
    global max_color
    color = 1
    for next_pos in tree[pos]:
        if color == before_color:
            color += 1
        if next_pos == before_pos:
            continue
        ans_ind = dic[(pos, next_pos)]
        if pos < next_pos:
            ans[ans_ind] = color
        else:
            ans[ans_ind] = color
        max_color = max(color, max_color)
        dfs(next_pos, pos, color)
        color += 1
dfs(0, -1, -1)

print(max_color)
for i in ans:
    print(i)
import sys
sys.setrecursionlimit(10 ** 9)

n = int(input())
tree = [[] for _ in range(n)]
dic = {}

for i in range(n - 1):
    a, b = map(int, input().split())
    tree[a - 1].append(b - 1)
    tree[b - 1].append(a - 1)
    dic[(a - 1, b - 1)] = i
ans = [0 for _ in range(n - 1)]
max_color = 0

def dfs(pos, before_pos, before_color):
    global max_color
    color = 1
    for next_pos in tree[pos]:
        if color == before_color:
            color += 1
        if next_pos == before_pos:
            continue
        ans_ind = dic[(pos, next_pos)]
        if pos < next_pos:
            ans[ans_ind] = color
        else:
            ans[ans_ind] = color
        max_color = max(color, max_color)
        dfs(next_pos, pos, color)
        color += 1
dfs(0, -1, -1)

print(max_color)
for i in ans:
    print(i)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)

n = int(input())
tree = [[] for _ in range(n)]
dic = {}

for i in range(n - 1):
    a, b = map(int, input().split())
    tree[a - 1].append(b - 1)
    tree[b - 1].append(a - 1)
    dic[(a - 1, b - 1)] = i
ans = [0 for _ in range(n - 1)]
max_color = 0

def dfs(pos, before_pos, before_color):
    global max_color
    color = 1
    for next_pos in tree[pos]:
        if color == before_color:
            color += 1
        if next_pos == before_pos:
            continue
        before = min(pos, next_pos)
        after = max(pos, next_pos)
        ans_ind = dic[(before, after)]
        if pos < next_pos:
            ans[ans_ind] = color
        else:
            ans[ans_ind] = color
        max_color = max(color, max_color)
        dfs(next_pos, pos, color)
        color += 1
dfs(0, -1, -1)

print(max_color)
for i in ans:
    print(i)
N = int(input())
A = list(map(int,input().split()))
l = [0]*N
for i in range(N+1):
  l[A[i]-1] += 1
for i in range(N):
  print(l[i])

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
l = [0]*N
for i in range(N-1):
  l[A[i]-1] += 1
for i in range(N):
  print(l[i])
r1, c1, r2, c2 = map(int, input().split())

#############

mod = 10**9 + 7
max = 2 * 10**6
fac, finv, inv = [0]*max, [0]*max, [0]*max

def comInit(max):
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1

    for i in range(2,max):
      fac[i] = fac[i-1]* i% mod
      inv[i] = mod - inv[mod%i] * (mod // i) % mod
      finv[i] = finv[i-1] * inv[i] % mod

comInit(max)

# 二項係数の計算
def com(n,k):
    if(n < k):
        return 0
    if( n<0 | k < 0):
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

#############
ans = (com(r2+c2+2,r2+1) - com(r2+c1+1, c1) - com(r1+c2+1, r1) + com(r1+c1, r1)) % mod

print(ans)

### FIXED CODE ###

r1, c1, r2, c2 = map(int, input().split())

#############

mod = 10**9 + 7
max = 3 * 10**6
fac, finv, inv = [0]*max, [0]*max, [0]*max

def comInit(max):
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1

    for i in range(2,max):
      fac[i] = fac[i-1]* i% mod
      inv[i] = mod - inv[mod%i] * (mod // i) % mod
      finv[i] = finv[i-1] * inv[i] % mod

comInit(max)

# 二項係数の計算
def com(n,k):
    if(n < k):
        return 0
    if( (n<0) | (k < 0)):
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

#############
ans = (com(r2+c2+2,r2+1) - com(r2+c1+1, c1) - com(r1+c2+1, r1) + com(r1+c1, r1)) % mod

print(ans)
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
m=int(input())
dc=[list(map(int,input().split())) for i in range(m)]
n=""
keta=0
for i in range(m):
    n+=str(dc[i][0])*dc[i][1]
    keta+=dc[i][1]
i=0
nex=int(n[i])
cnt=0
while(i<keta-1):
    tmp=nex+int(n[i+1])
    if tmp>9:
        tmp=str(tmp)
        tmp=int(tmp[0])+int(tmp[1])
        cnt+=1
    nex=tmp
    i+=1
    cnt+=1
    # print(cnt,nex)
print(cnt)

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
m=int(input())
dc=[list(map(int,input().split())) for i in range(m)]
tmp=0
ans=0
for i in range(m):
    tmp+=dc[i][0]*dc[i][1]
    ans+=dc[i][1]
# print(tmp)
ans-=1
ans+=(tmp-1)//9
print(ans)
def main():
    import collections
    n, *a = map(int, open(0).read().split())
    c = collections.Counter(a)
    if n % 2 == 0:
        f = all(x == 2 for x in c.values())
    else:
        g = c.pop("0") == 1
        f = all(x == 2 for x in c.values()) and g
    ans = 2 ** (n // 2) % 1000000007 if f is True else 0
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import collections
n=int(input())
l=list(input().split())
c=collections.Counter(l)
if n%2==0:
  f=all(x==2 for x in c.values())
else:
  g=c.pop("0")==1
  f=all(x==2 for x in c.values()) and g
print(2**(n//2)%1000000007 if f==True else 0)
from operator import mul
from functools import reduce
def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom
n = int(input())
a_ls = list(map(int, input().split()))
a_ls.sort()
num_total = a_ls[-1]
a_ls.pop()
def isOK(index, key, l):
    if l[index] >= key:
        return True
    else:
        return False
def meguru_search(l, key):
    '''
    key以上の値を持つ最小のインデックスを返す
    '''
    left = -1
    right = len(l)

    while (right - left) > 1:
        mid = left + (right - left) // 2
        # 直感的に記憶　
            # 「含まれている」んだったら「含むを許容（等号付き）する右側」はmidまで動かして問題ない
                # 新しいrightの位置がkeyの位置だとしても、「含む」は許容されてる
            # 「含まれていない」んだったら「含まない(<)左の壁」をそこまで動かしてもkeyを通り過ぎることはない
        if isOK(mid, key, l):
            right = mid
        else:
            left = mid
    
    # whileを抜ける時、rightとleftは一個差で、かつkeyがrightの位置にある
    return right

if num_total % 2 == 0:
    Max = num_total // 2
else:
    Max = num_total // 2 + 1
Maxind1 = meguru_search(a_ls, Max)
Maxind2 = Maxind1 - 1
if combinations_count(num_total, a_ls[Maxind1]) > combinations_count(num_total, a_ls[Maxind2]):
    r = a_ls[Maxind1]
else:
    r = a_ls[Maxind2]
print(num_total, r)
    

    


### FIXED CODE ###

n = int(input())
a_ls = list(map(int, input().split()))
if n > 2:
    a_ls.sort()
    num_total = a_ls[-1]
    a_ls.pop()
    def isOK(index, key, l):
        if l[index] >= key:
            return True
        else:
            return False
    def meguru_search(l, key):
        '''
        key以上の値を持つ最小のインデックスを返す
        '''
        left = -1
        right = len(l)

        while (right - left) > 1:
            mid = left + (right - left) // 2
            # 直感的に記憶　
                # 「含まれている」んだったら「含むを許容（等号付き）する右側」はmidまで動かして問題ない
                    # 新しいrightの位置がkeyの位置だとしても、「含む」は許容されてる
                # 「含まれていない」んだったら「含まない(<)左の壁」をそこまで動かしてもkeyを通り過ぎることはない
            if isOK(mid, key, l):
                right = mid
            else:
                left = mid
        
        # whileを抜ける時、rightとleftは一個差で、かつkeyがrightの位置にある
        return right

    if num_total % 2 == 0:
        Max = num_total // 2
    else:
        Max = num_total // 2 + 1
    Maxind1 = meguru_search(a_ls, Max)
    Maxind2 = Maxind1 - 1
    abs_1 = abs(Max - a_ls[Maxind1])
    abs_2 = abs(Max - a_ls[Maxind2])
    if abs_1 > abs_2:
        r = a_ls[Maxind2]
    else:
        r = a_ls[Maxind1]
    print(num_total, r)
else:
    print(max(a_ls), min(a_ls))
S = input()

while True:
  if S[-5:] == 'dream':
    S = S[:-5]
    continue
  elif S[:-7] == 'dreamer':
    S = S[:-7]
    continue
  elif S[-5:] == 'erase':
    S = S[:-5]
    continue
  elif S[-7:] == 'eraser':
    S = S[:-7]
    continue
  break

answer = 'YES' if not S else 'NO
print(answer)

### FIXED CODE ###

S = input()

while True:
  if S[-5:] == 'dream':
    S = S[:-5]
    continue
  elif S[-7:] == 'dreamer':
    S = S[:-7]
    continue
  elif S[-5:] == 'erase':
    S = S[:-5]
    continue
  elif S[-6:] == 'eraser':
    S = S[:-6]
    continue
  break

answer = 'YES' if not S else 'NO'
print(answer)
N, A = map(int, input().split())
if ( N - A ) % 500 == 0:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

n = int(input())
a = int(input())
if  n% 500 <= a:
	print("Yes")
else:
	print("No")
from math import factorial
n = int(input())
l = list(map(int, input().split()))

dict = {}
for i in l:
    if i not in dict:
        dict[i] = 1
    else:
        dict[i] += 1

for j in l:
    ans = 0
    k = dict.copy()
    k[j] -= 1
    for v in k.values():
        if v > 1:
            ans += int(factorial(v) / factorial(2) / factorial(v - 2))
    print(ans)


### FIXED CODE ###

import collections
from collections import defaultdict

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

dict = defaultdict(int)
for i in l:
    dict[i]+=1

ans = 0
for v in dict.values():
    ans += int((v*(v-1)) // 2)

for k in l:
    print(ans - (dict[k] - 1))
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
anss = []
for i in range(1, 1+N):
    if a[i] > K:
        break
    ans = 0
    for j in range(M, -1, -1):
        if a[i] + b[j] <= K:
            ans = j
            break
    ans += i
    anss.append(ans)
    
            
print(max(anss))


### 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
anss = []
for i in range(1+N):
    if a[i] > K:
        break
    while 1:
        if a[i] + b[j] <= K:
            break
        j -= 1
    
    ans = max(ans, i+j)
    
            
print(ans)
n, k = input().split()
print(n, k)
N = int(n)
K = int(k)

h_array = []
for i in range(N):
    tree = int(input())
    h_array.append(tree)

h_array.sort()

#最小値を更新していくので、初期値を無限として設定しておく
result = float("inf")
#indexに注意
for i in range(k - 1, N):
    result = min(result, h_array[i] - h_array[i - k + 1])

print(result)


### FIXED CODE ###

n, k = map(int, input().split())
array = sorted([int(input()) for x in range(n)])
tmp = float("inf")
for i in range(k-1, n):
    tmp = min(tmp, array[i]-array[i-k+1])
print(tmp)
S=input()
Sn=0
for i in range(1, 10):
	if i > len(S):break
	Sn += int(S[-i])
ans = "No"
if int(S) % Sn == 0:ans = "Yes"

print(ans)

### FIXED CODE ###

S=input()
Sn=0
for i in range(1, 10):
	if i > len(S):break
	Sn+=int(S[-i])
ans = "No"
if Sn == 0 or int(S) % Sn == 0:ans = "Yes"

print(ans)
import numpy as np
def comb_mod(n, a, m):
  if a > n:
    return 0
  a = min(a, n-a+1)
  # tbl = [[0]*(a+1) for _ in range(2)]
  tbl = np.zeros((2, a+1), dtype=np.int64)
  tbl[0][0] = 1
  tbl[1][0] = 1
  # for i in tqdm(range(n)):
  for i in range(n):
    # tbl[i%2][0] = 1
    tbl[i%2][1:] = (tbl[(i+1)%2][1:] + tbl[(i+1)%2][:-1]) % m
    # for k in range(min(i+1, len(tbl[i%2]))):
    #   if i == k:
    #     tbl[i%2][k] = 1
    #   elif i < k:
    #     tbl[i%2][k] = 0
    #   elif k == 0:
    #     tbl[i%2][k] = 1
    #   else:
    #     tbl[i%2][k] = (tbl[(i-1)%2][k-1] + tbl[(i-1)%2][k]) % m
  return tbl[(n-1)%2][a]

n, a, b = map(int, input().split(' '))
c = 0
for i in range(1, n+1):
  if i == a or i == b:
    continue
  c += comb_mod(n, i, 1000000007)
print(c)

### FIXED CODE ###

N, R = input().split(' ')
N = int(N)
R = int(R)
if N >= 10:
  I = R
else:
  I = R + 100 * (10 - N)
print(I)
n=int(input())
p=[0]*(10**6+1)
for i in range(1,int(n**0.5)+1):
    cnt=0
    while n%(i+1)==0:
        n//=i+1
        cnt+=1
    p[i+1]+=cnt
if n>1:
    p[n]+=1
ans=0
for i in p:
    for j in range(1,44):
        if j*(j+1)//2>i:
            ans+=j-1
            break
print(ans)


### FIXED CODE ###

n=int(input())
d=dict()
for i in range(1,int(n**0.5)+1):
    cnt=0
    while n%(i+1)==0:
        n//=i+1
        cnt+=1
    d[i+1]=cnt
if n>1:
    if n in d:
        d[n]+=1
    else:
        d[n]=1
ans=0
d=list(d.items())
for i,r in d:
    for j in range(1,44):
        if j*(j+1)//2>r:
            ans+=j-1
            break
print(ans)