Harryxun/stf_run huggingface dataset:
N = int(input())
def cal(n):
    return n * (n + 1) // 2
for i in range(1, N+1):
    x = N // i
    ans += i * (x * (x + 1) // 2)
print(ans)

### FIXED CODE ###

N = int(input())
mul = [0] * (N+1)
for i in range(1, N+1):
    for j in range(i, N+1, i):
        mul[j] += 1
ans = 0
for i in range(1, N+1):
    ans += i * mul[i]
print(ans)
# -*- coding: utf-8 -*-

n, k = map(int, raw_input().split())

print k * (k-1) ** (n-1)


### FIXED CODE ###

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

colour_list = [a, b, c]
bought = []
count = 0
for x in colour_list:
    if x not in bought:
        bought.append(x)
        count += 1

print count
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = np.array([10**10]*(n))
dp[0] = 0
if n-1 <= k:
    print(abs(h[-1]-h[0]))
else:
    for i in range(1,k+1):
        dp[i] = abs(h[i]-h[0])
    for i in range(k+1,n): 
        for j in range(1,k+1):
            dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]))
    print(dp[-1])

### FIXED CODE ###

import numpy as np
n,k = map(int, input().split())
h = np.array(list(map(int, input().split())))

dp = np.zeros(n, dtype = int)
for i in range(1,n):
    s = max(0,i-k)
    dp[i] = min(dp[s:i] + np.abs(h[i] -h[s:i]))
print(dp[-1])
N = int(input())

print(int((N * (N - 1)) // 2))

### FIXED CODE ###

S = input()
T = input()


cnt = 0
for i in range(3):
    if S[i] == T[i]:
        cnt += 1

print(cnt)
N,X,T = map(int,input().split())
print(-(-N//X*T)

### FIXED CODE ###

N,X,T = map(int,input().split())
print(-(-N//X)*T)
K = int(input())
S = input()
if len(S) <= K:
  print(S)
else:
  l = S.split()
  l.pop(K:)
  print(''.join(l))

### FIXED CODE ###

K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  print(S[:K]+'...')
a = list(map(int,input().split()))
i = a[0]

lst = []
while i > 0:
    lst.append(i%10)
    i //= 10 # 必須
lst.reverse()

flag = 0;
for k in range(3):
  if lst[k] == lst[k+1]:
    flag = 1
    
if flag == 1:
  print("Bad")
else:
  print("Good")
    

### FIXED CODE ###

a = list(map(str,input().split()))
i = a[0]

lst = list(i)

flag = 0;
for k in range(3):
  if lst[k] == lst[k+1]:
    flag = 1
    
if flag == 1:
  print("Bad")
else:
  print("Good")
# input
N, C = map(int, input().split(" "))
x, v = [], []
for i in range(1, N+1):
    xv = list(map(int, input().split(" ")))
    x.append(xv[0])
    v.append(xv[1])

# x_i メートル
# v_i キロカロリー
max_cal = 0
S = [[i for i in range(N)]]  # stack
place = 0  # 位置
cal = 0
S[0].append(cal)
S[0].append(place)
while len(S) > 0:
    s = S.pop()  # n = len
    # index -1 : place
    # index -2 : calorie
    if len(s) == 3:
        # len(s) = 1 になったとき
        idx = s[0]  # first
        next_place = x[idx]
        place_step = min(dist, C - dist)
        next_cal = s[-2] - place_step + v[s[0]]
        max_cal = max(max_cal, next_cal)
    else:
        #while len(s) > 1:
        # x[s[0]] は s[0] 番目の寿司の相手ある絶対位置（初期値からの距離）
        place = s[-1]
        idx = s[0]  # first
        next_place = x[idx]
        dist = abs(next_place - place)
        place_step = min(dist, C - dist)
        next_cal = s[-2] - place_step + v[idx]
        max_cal = max(max_cal, next_cal)
        S.append(s[1:-2] + [next_cal, next_place])
        place = s[-1]
        idx = s[-3]  # last
        next_place = x[idx]
        #place_step = abs(next_place - place) % C
        place_step = min(dist, C - dist)
        next_cal = s[-2] - place_step + v[idx]
        max_cal = max(max_cal, next_cal)
        S.append(s[:-3] + [next_cal, next_place])
print(max_cal)

### FIXED CODE ###

input_str = input()

A, B, C, X, Y = input_str.split(" ")

A = int(A)
B = int(B)
C = int(C)
X = int(X)
Y = int(Y)

answer = 0
ave_AB = (A + B) / 2
if ave_AB <= C:
    answer = X*A + Y*B
else:
    xy_min = min(X,Y)
    answer = xy_min * C * 2
    tmp = X - Y
    if tmp > 0:
        if A < C*2:
            answer += tmp*A
        else:
            answer += tmp*C*2
    elif tmp < 0:
        if B < C*2:
            answer += -tmp*B
        else:
            answer += -tmp*C*2
print(answer)
b,a = input().split()
print(''.join([a,b].strip())

### FIXED CODE ###

b,a = input().split()
print(''.join([a,b]).strip())
input()
s=[list(map(int,input().split()))for i in range(n)]
print(sum(sorted([x[1]+x[0] for x in s])[::-2])-sum([x[1]for x in s]))

### FIXED CODE ###

n=int(input())
s=[list(map(int,input().split()))for i in range(n)]
print(sum(sorted([x[1]+x[0] for x in s])[::-2])-sum([x[1]for x in s]))
MAX_INT = 10**6
N, M = map(int, input().split())
room = dict()
for i in range(M):
    a, b = map(int, input().split())
    if room.get(a):
        room[a] += [b]
    else:
        room[a] = [b]
    if room.get(b):
        room[b] += [a]
    else:
        room[b] = [a]

dis = [MAX_INT] * (N + 1)
sign = [-1] * (N + 1)
dis[1] = 0
def sign_root(n):
    nxt = []
    for i in room[n]:
        if dis[n] + 1 < dis[i]:
            sign[i] = n
            dis[i] = dis[n] + 1
            sign_root(i)
sign_root(1)
if MAX_INT in dis[2:]:
    print("No")
else:
    print("Yes")
    for i in sign[2:]:
        print(i)

### FIXED CODE ###

MAX_INT = 10**6
N, M = map(int, input().split())
room = [set() for _ in range(N+1)]
for i in range(M):
    a, b = map(int, input().split())
    room[a].add(b)
    room[b].add(a)

dis = [MAX_INT] * (N + 1)
sign = [-1] * (N + 1)
dis[1] = 0
def sign_root(n):
    nxt = []
    for i in room[n]:
        if dis[n] + 1 < dis[i]:
            sign[i] = n
            dis[i] = dis[n] + 1
            nxt += [i]
    return nxt

nxt = sign_root(1)
while nxt != []:
    for i in nxt.copy():
        nxt.pop(0)
        nxt += sign_root(i)
if MAX_INT in dis[2:]:
    print("No")
else:
    print("Yes")
    for i in sign[2:]:
        print(i)
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
q=i1()
import math
y=[]
for i in range(q):
 y.append(i2())

for a,b in y:
 x=a*b
 c=int(math.sqrt(x))
 if c**2==x:
    c-=1
 z=2*c
 if  (x//c)==c:
   z-=1
 if x%c==0 and (x//c-1)==c:
   z-=1
 if a<=c:
   z-=1
 if b<=c:
   z-=1
 print(z)

### FIXED CODE ###

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
q=i1()
import math
y=[]
for i in range(q):
 y.append(i2())

for a,b in y:
 x=a*b
 c=int(math.sqrt(x))
 if c**2==x:
    c-=1
 z=2*c
 if c>0 and (x//c)==c:
   z-=1
 if c>0 and x%c==0 and (x//c-1)==c:
   z-=1
 if a<=c:
   z-=1
 if b<=c:
   z-=1
 print(z)
n,m=map(int,input().split())
a=list(map(int,input().split()))
 
toku = sum(a) // (4*m)
 
a.sort(reverse=True)
if a[m-1] >= toku:
  print("Yes")
  else:
  print("No")

### FIXED CODE ###

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

toku = sum(a) / (4 * m)
a=sorted(a,reverse=True)
    
if a[m-1] >= toku:
    print("Yes")
else:
    print("No")
n = int(input())
ans = 0
for i in range(1,n+1):
    ans += (n//i)*(n//i + 1)/2*i
print(int(ans))

### FIXED CODE ###

def cmb(n, r, mod):#コンビネーションの高速計算　
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 5*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

N, M = map(int, input().split())
ans = 0
for i in range(N+1):
    ans += cmb(N,i,mod)*((-1)**i)*g1[M]*g2[M-i]*((g1[M-i]*g2[M-N])**2)
    ans %= mod
print(ans)
dic = {
  1: 2,
  2: 5,
  3: 5,
  4: 4,
  5: 5,
  6: 6,
  7: 3,
  8: 7,
  9: 6
}

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
dic2 = {}
for i in A:
    try:
      dic2[dic[i]]
    except:
      dic2[dic[i]] = i 
result_list = []
items = sorted(dic2.items())
while True:
  if len(items) == 0:
    break
  else:
    if N >= items[0]:
      result_list.append(items[1])
      N = N - items[0]
    else:
      items.pop(0)
return sorted(result_list, reverse=True)
  

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
 
dp = [-1 for i in range(N+10)]
l = [0,2,5,5,4,5,6,3,7,6]
dp[0] = 0
for i in range(N-1):
    for s in A:
        if dp[i] == -1 and i!=0:
            continue
        if dp[i + l[s]] < dp[i]*10+s:
            dp[i + l[s]] = dp[i]*10+s
print(dp[N])
N,D = map(int, input().split())

if D == 1:
  print(N * (N-1) // 2)
else:
  A = [0] * D
  count = 0
  sei = 0

  for i in range(0,N):
	  A[i] = list(map(int, input().split()))
    
  for p in range(0,N):
      for q in range(0,N):
          sum = 0
    
          for r in range(0,D):
              sum = sum + (A[p][r]-A[q][r]) ** 2
           
          sum = sum ** 0.5 
          sei = int(sum)
        
          if sum != 0 and sum == sei:
              count = count + 1
      
  print(count // 2)


### FIXED CODE ###

N,D = map(int, input().split())

if D == 1:
  print(N * (N-1) // 2)
else:
  A = [0] * N
  count = 0
  sei = 0

  for i in range(0,N):
	  A[i] = list(map(int, input().split()))
    
  for p in range(0,N):
      for q in range(0,N):
          sum = 0
    
          for r in range(0,D):
              sum = sum + (A[p][r]-A[q][r]) ** 2
           
          sum = sum ** 0.5 
          sei = int(sum)
        
          if sum != 0 and sum == sei:
              count = count + 1
      
  print(count // 2)
class ABC104:
    modulus = 10 ** 9 + 7

    def __init__(self, s):
        self.s = s
        self.n = len(s)

    def dp(self, i, j):
        """
        dynamic programming for abc 104
        :param i: index of the given string
        :param j: count of letters of composed string (like 'ABC')
        :return: the number of cases
        """
        if i == self.n:
            if j == 3:
                return 1
            else:
                return 0

        if i < self.n and j == 3:
            m = 3 if self.s[i] == '?' else 1
            return m * self.dp(i + 1, 3) % self.modulus

        if i < self.n and j < 3:
            m1 = 3 if self.s[i] == '?' else 1
            m2 = 1 if self.s[i] == '?' or self.s[i] == 'ABC'[j] else 0

            _pass = m1 * self.dp(i + 1, j) % self.modulus
            _take = m2 * self.dp(i + 1, j + 1) % self.modulus

            return  _pass + _take


if __name__ == '__main__':
    abc = ABC104(input())
    print(abc.dp(0, 0))


### FIXED CODE ###

if __name__ == "__main__":
    modulus = 10 ** 9 + 7
    s = input()
    n = len(s)
    dp = [[0] * 4 for _ in range(n + 1)]

    for i in range(n + 1)[::-1]:
        for j in range(4)[::-1]:
            if i == n:
                if j == 3:
                    dp[i][j] = 1
                else:
                    dp[i][j] = 0
            else:
                is_wildcard = s[i] == '?'
                if j == 3:
                    m = 3 if is_wildcard else 1
                    dp[i][j] = m * dp[i + 1][3] % modulus

                else:
                    m1 = 3 if is_wildcard else 1
                    m2 = 1 if is_wildcard or s[i] == 'ABC'[j] else 0

                    dp[i][j] = (m1 * dp[i + 1][j] + m2 * dp[i + 1][j + 1]) % modulus
            # print(i, j, dp[i][j])
    print(dp[0][0])
(a,b)=input(),input()
c=int(a)-int(b)+1
print(c)

### FIXED CODE ###

a,b=map(int,input().split())
t=a-b+1
print(t)
N = int(sys.argv[1])

dev_type = ""
if N%10==(2or4or5or7or9):
  dev_type = "hon"
elif if N%10==(0or1or6or8):
  dev_type = "pon"
else:
  dev_type = "hon"
  
print(dev_type)

### FIXED CODE ###

n = input()
if (n[-1] == "2")or(n[-1] == "4")or(n[-1] == "5")or(n[-1] == "7")or(n[-1] == "9") :
    print("hon")
elif (n[-1] == "0")or(n[-1] == "1")or(n[-1] == "6")or(n[-1] == "8"):
    print("pon")
else:
    print("bon")
import math

INF = float("inf")

V, E = map(int, input().split())
es = []

for _ in range(E):
    a, b, c = map(int, input().split())
    es.append([a-1, b-1, -c])

d = [INF] * V
d[1] = 0

for _ in range(V - 1):
    updated = False
    for e in es:
        if math.isinf(d[e[0]]):
            continue
        if d[e[1]] > d[e[0]] + e[2]:
            d[e[1]] = d[e[0]] + e[2]
            updated = True
    if not updated:
        break

negative = [False] * V

for _ in range(V):
    for e in es:
        if math.isinf(d[e[0]]):
            continue
        if d[e[1]] > d[e[0]] + e[2]:
            negative[e[1]] = True
            d[e[1]] = d[e[0]] + e[2]
        elif negative[e[1]]:
            d[e[1]] = True
print(-d[V] if not negative[V] else "inf")


### FIXED CODE ###

import math

INF = float("inf")

V, E = map(int, input().split())
es = []

for _ in range(E):
    a, b, c = map(int, input().split())
    es.append([a-1, b-1, -c])

d = [INF] * V
d[0] = 0
cnt = [0] * V

for _ in range(V):
    updated = False
    for e in es:
        if math.isinf(d[e[0]]):
            continue
        if d[e[1]] > d[e[0]] + e[2]:
            d[e[1]] = d[e[0]] + e[2]
            cnt[e[1]] += 1
            updated = True
    if not updated:
        break

print(-d[V-1] if cnt[V-1] < V else "inf")
import collections
 
n = int(input())
vs = [int(i) for i in input().split()]
evens = []
odds = []
for i,num in enumerate(vs):
    if i % 2 == 0:
        evens.append(num)
    elif i % 2 == 1:
        odds.append(num)
 
def plana():
    if (len(set(vs)) == 2) and (len(set(evens)) == 1) and (len(set(odds)) == 1):
        return 0
    elif (len(set(vs)) == 1):
        return len(evens)
    return 0
    ec = collections.Counter(evens)
    oc = collections.Counter(odds)
 
    count = 0
    count += (len(evens) - ec.most_common()[0][1])
    count += (len(odds) - oc.most_common()[0][1])
    return count
 
# if len(set(vs)) == 1:
#     print(int(len(vs)/2))
# elif (len(set(evens)) == 1) and (len(set(odds)) == 1):
#     print(0)
# else:
print(int(plana()))

### FIXED CODE ###

inums = input()
# [int(i)for i in input().split()]
nums = []
for i in inums:
    nums.append(int(i))
o = []
for n in nums:
    if n == 1:
        o.append("9")
    elif n==9:
        o.append("1")
    else:
        o.append(str(n))
print("".join(o))
n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
global mins
mins = min(seq)
global sums
sums = sum(mlist)

def check(i, m):
    if m == 0:
        return True
    elif i >= n:
        return False
    res = check(i+1, m) + check(i+1, m - seq[i])
    return res

for m in mlist:
    if (mins > m or sums < m):
        print('no')
    elif(check(0,m)):
        print('yes')
    else:
        print('no')


### FIXED CODE ###

n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
mins = min(seq)
sums = 0
for a in seq:
    sums += a

def check(i, m):
    global mins
    if m == 0:
        return True
    elif i >= n or mins > m:
        return False
    res = check(i+1, m) or check(i+1, m - seq[i])
    return res

for m in mlist:
    if (mins > m or sums < m):
        print('no')
    elif(check(0,m)):
        print('yes')
    else:
        print('no')
import bisect

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

# ある値以上のAiがいくつあるかの情報を累積和で保持
num_A_or_more = [0]*(10**5)
for a in A:
  num_A_or_more[a-1] += 1


for i in range(1, 10**5):
  j = 10**5 - i
  num_A_or_more[j-1] += num_A_or_more[j]


# x以上となる手の組み合わせがM種類以上あるかどうかを判定
def check(x):
  count = 0
  for a in A:
    idx = max(x-a-1, 0)
    count += num_A_or_more[idx]
  
  return count>=M


# 2分探索でM種類以上の手の組み合わせがある満足度の最大値を求める
left = 0
right = 2*10**5 + 1
mid = (left + right) // 2
while right - left > 1:
  if check(mid):
    left = mid
  else:
    right = mid
    
  mid = (left + right)//2

# これがM種類以上の手の組み合わせがある満足度の最大値
x = left


# 降順に並べなおして累積和を求めておく
rev_A = A[::-1]
accum_A = [rev_A[0]]
for i, a in enumerate(rev_A):
  if i == 0:
    continue
  accum_A.append(accum_A[-1] + a)

ans = 0
count = 0
surplus = 2*10**5 # M種類を超えた場合は、一番小さくなる握手の組を最後に削る
for ai in rev_A:
  idx = bisect.bisect_left(A, x-ai)
  if idx == N:
    break
  ans += (N-idx)*ai + accum_A[N-idx-1]
  count += N - idx
  surplus = min(surplus, ai+A[idx])


print(ans - (count-M)*surplus)

### FIXED CODE ###

import bisect

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
rev_A = A[::-1]

def check(x, a=A, m=M):
  result = False
  n = len(a)
  count = 0
  for ai in a:
    count += (n - bisect.bisect_left(a, x-ai))
  
  return count>=m


left = 0
right = 2*10**5 + 1
mid = (left + right) // 2
while right - left > 1:
  if check(mid):
    left = mid
  else:
    right = mid
    
  mid = (left + right)//2

x = left
if check(right):
  x = right

accum_A = [rev_A[0]]
for i, a in enumerate(rev_A):
  if i == 0:
    continue
  accum_A.append(accum_A[-1] + a)

ans = 0
count = 0
surplus = 2*10**5
for ai in rev_A:
  idx = bisect.bisect_left(A, x-ai)
  if idx == N:
    break
  ans += (N-idx)*ai + accum_A[N-idx-1]
  count += N - idx
  surplus = min(surplus, ai+A[idx])


print(ans - (count-M)*surplus)
a,b,c = map(int, input().split())
if (a==b or a==c) and (b!=c):
    print('Yes')
elif (b==a or b==c) and (a!=c):
    print('Yes')
elif (c==a or c==b) and (a!=b):
    print('Yes')
else:
    print('No')



n = int(input())
flag=0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i%2==0 and i%3!=0 and i%5!=0:
        flag=1 
    else:
        continue
if flag==1:
    print("DENIED")
else:
    print("APPROVED")

### FIXED CODE ###

n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")
N = int(input())
S = [None] * N

for i in range(0, N):
    S[i] = [int(s) for s in list(input())]

m = 0
n_partite = True

for n in range(0, N):  # try starting with every vertex
    levels = [None] * N
    levels[n] = 0

    for l in range(0, N): # max possible levels
        for i in range(0, N): # look at every vertex
            if levels[i] == l: # vertex i is at level l
                # scan column S[i]
                for j in range(0, N): # scan all vertices and look for adjacent vertex to i
                    if S[i][j] == 1: # vertex j is adjacent to i
                        if levels[j] == None:
                            levels[j] = l + 1
                        elif levels[j] == l - 1: continue
                        elif levels[j] == l + 1: continue
                        else:
                            n_partite = False
                            break
    m = max( max(levels), m)

if n_partite:
    print(m + 1)
else:
    print(-1)


### FIXED CODE ###

N = int(input())
S = [None] * N

for i in range(0, N):
    S[i] = [int(s) for s in list(input())]


def local_max_level(S, N, n): # n is the starting vertex
    levels = [None] * N
    levels[n] = 0

    for l in range(0, N): # for each level l
        for i in range(0, N): # look at every vertex i
            if levels[i] == l: # which is at level l
                # scan column S[i]
                for j in range(0, N): # scan all vertices and look for adjacent vertex to i
                    if S[i][j] == 1: # vertex j is adjacent to i
                        if levels[j] == None:
                            levels[j] = l + 1

                        elif levels[j] == l - 1: continue
                        elif levels[j] == l + 1: continue
                        else:
                            return -1
    return max(levels)

def n_partite(S, N):

    M = 0
    for n in range(0, N):  # try starting with every vertex
        m = local_max_level(S, N, n)
        if m == -1: # not n-partite
            return -1
        else:
            M = max(M, m)
    return M + 1

print(n_partite(S, N))
import math

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

cdlcm=c*d/math.gcd(c,d)

cd=b//c-(a-1)//c
dd=b//d-(a-1)//d
cdd=b//(cdlcm)-(a-1)//(cdlcm)

print(round(b-a+1-(cd+dd-cdd)))

### FIXED CODE ###

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

def gcd(a,b):
    if a==0:
        return b
    else:
        return gcd(b%a,a)

cdlcm=c*d//gcd(c,d)

cd=b//c-(a-1)//c
dd=b//d-(a-1)//d
cdd=b//(cdlcm)-(a-1)//(cdlcm)

print(round(b-a+1-(cd+dd-cdd)))
from functools import lru_cache


@lru_cache
def factorial(n):
    if n == 0:
        return 1
    return (n * factorial(n-1)) % MOD


@lru_cache
def ifactorial(n):
    return pow(factorial(n), MOD-2, MOD)


@lru_cache
def combination(n, k):
    return (factorial(n) * ifactorial(k) * ifactorial(n - k)) % MOD


k = int(input())
s = input()
MOD = 10**9+7

ans = 0
for i in range(k + 1):
    tmp = combination(i + len(s) - 1, len(s) - 1)
    tmp *= pow(25, i, MOD)
    tmp *= pow(26, k - i, MOD)
    tmp %= MOD
    ans += tmp
    ans %= MOD
print(ans)


### FIXED CODE ###

MOD = 10**9+7

k = int(input())
s = input()
MAX = k + len(s)

factorial = [0] * (MAX + 1)
factorial[0] = 1
for i in range(1, MAX + 1):
    factorial[i] = factorial[i-1] * i % MOD


ifactorial = [0] * (MAX + 1)
ifactorial[MAX] = pow(factorial[MAX], MOD - 2, MOD)
for i in range(MAX, 0, -1):
    ifactorial[i - 1] = ifactorial[i] * i % MOD

pow25 = [1] * (k + 1)
pow26 = [1] * (k + 1)
for i in range(k):
    pow25[i + 1] = pow25[i] * 25
    pow25[i + 1] %= MOD
    pow26[i + 1] = pow26[i] * 26
    pow26[i + 1] %= MOD


def combination(n, k):
    ret = factorial[n] * ifactorial[k] * ifactorial[n - k]
    return ret % MOD


ans = 0
for i in range(k + 1):
    tmp = combination(i + len(s) - 1, len(s) - 1)
    tmp *= pow25[i]
    tmp %= MOD
    # tmp *= pow(25, i, MOD)
    tmp *= pow26[k - i]
    # tmp *= pow(26, k - i, MOD)
    tmp %= MOD
    ans += tmp
    ans %= MOD
print(ans)
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

numA = 0
numB = 0
count = 0
time = 0
for i in range(N+M):
  if numA < N and numB < M:
    if A[numA] > B[numB] and time + B[numB] <= K:
      count += 1
      time += B[numB]
      numB += 1
    elif A[numA] < B[numB] and time + A[numA] <= K:
      count += 1
      time += A[numA]
      numA += 1
    elif A[numA] == B[numB]:
      if numA == N-1 and time + B[numB] <= K:
        count += 1
        time += B[numB]
        numB += 1
      elif numB == M-1 and time + A[numA] <= K:
        count += 1
        time += A[numA]
        numA += 1
      elif A[numA + 1] > B[numB + 1] and time + B[numB] <= K:
        count += 1
        time += B[numB]
        numB += 1        
      elif A[numA + 1] <= B[numB + 1] and time + A[numA] <= K:    
        count += 1
        time += A[numA]
        numA += 1    
      else:
        break
    else:
      break
  else:
    if numA >= N and numB < M and time + B[numB] <= K:
      count += 1
      time += B[numB]
      numB += 1
    elif numB >= M and numA < N and time + A[numA] <= K:
      count += 1
      time += A[numA]
      numA += 1
    else:
      break
print(count)

### FIXED CODE ###

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

a = [0 for _ in range(N+1)]
b = [0 for _ in range(M+1)]

for i in range(1,N+1):
  a[i] = a[i-1] + A[i-1]
  
for j in range(1,M+1):
  b[j] = b[j-1] + B[j-1]
  
num = M
ans = 0
for k in range(N+1):
  if a[k] > K:
    break
  while b[num] > K - a[k]:
    num -= 1
  ans = max(ans, k+num)
  
print(ans)
import math
N,K = map(int,input().split())
k = 10**9+7
for i in range(1,K+1):
  A= 1
  for j in range(i-1):
    A *= K-1-j
  A = A//math.factorial(i-1)%k
  B = math.factorial(N-K+1)//math.factorial(N-K-i+1)//math.factorial(i)%k
  print(A*B%k)

### FIXED CODE ###

import math
N,K = map(int,input().split())
k = 10**9+7
for i in range(1,K+1):
  A= 1
  for j in range(i-1):
    A *= K-1-j
  A = A//math.factorial(i-1)%k
  B = 1
  if N-K-i+1>=0:
    B = math.factorial(N-K+1)//math.factorial(N-K-i+1)//math.factorial(i)%k
    print(A*B%k)
  else:
    print(0)