Harryxun/stf_run huggingface dataset:
n,x = map(int,input().split())
l = [ int(i) for i in input().split() ]
st = 0
cnt = 1
for i range(0,n):
  st += l[i]
  if st > x:
    break
  cnt += 1
print(cnt)

### FIXED CODE ###

n,x = map(int,input().split())
l = [ int(i) for i in input().split() ]
st = 0
cnt = 1
for i in range(0,n):
  st += l[i]
  if st > x:
    break
  cnt += 1
print(cnt)
from math import factorial
N,K = map(int, input().split())
mod = 10**9 + 7
def com(n,r):
    return int(factorial(n) // factorial(r) // factorial(n-r))
for i in range(1,K+1):
    comb = com(N-K+1,i)
    sec = com(K-1,i-1)
    print((comb * sec)%mod)

### FIXED CODE ###

from math import factorial
N,K = map(int, input().split())
mod = 10**9 + 7
def com(n,r):
    if n<r:
        return 0
    return int(factorial(n) // factorial(r) // factorial(n-r))
for i in range(1,K+1):
    comb = com(N-K+1,i)
    sec = com(K-1,i-1)
    print((comb * sec)%mod)
n = int(input())
x = list(map(int, input().split()))
ans = x[0]
for i in range(1,n):
	ans = ans * x[i]
	if ans > 10 ** 18 and x not in 0:
		ans = -1
		break
print(ans)

### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))
ans = x[0]
if 0 in x:
	ans = 0
else:
	for i in range(1,n):
		ans = ans * x[i]
		if ans > 10 ** 18:
			ans = -1
			break
print(ans)
n,a,b = map(int,input().split())

fac = [0 for _ in range(n+1)]
inv = [0 for _ in range(n+1)]
finv = [0 for _ in range(n+1)]

fac[0] =fac[1]= 1
inv[0] =inv[1]= 1
finv[0] = finv[1] = 1

p = 10**9 + 7
#p = 31
#inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
for i in range(2,n+1):
    fac[i] = (fac[i-1]*i)%p
    inv[i] = (p - inv[p%i]*int(p/i)%p)%p
    finv[i] = (finv[i-1]*inv[i])%p
    
#print(fac)
#print(inv)
#print(finv)

def cal(m,k):
    return fac[m]*(finv[k]*finv[m-k]%p)%p

ans=pow(2,n,mod) - 1
ans = (ans - cal(n,a) - cal(n,b))%p

if(ans<0):
    ans = -1*ans

print(ans)

### FIXED CODE ###

import math

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

p = 10**9 + 7


def cmb(n, r):
    total = 1
    for i in range(r):
        total = total * (n - i) % p
        
    return total * pow(math.factorial(r), p - 2, p) % p

total = pow(2, n, p)-1
a_total = cmb(n, a)
b_total = cmb(n, b)
print((total - a_total - b_total) % p)
a = int(input())
b = input()

def func(c):
    x = c.count("1")
    n = 1
    nsum = 0
    for i in reversed(range(len(c))):
        if c[i] == "1":
            nsum += n
            if n > x:
                n = n % x
        n *= 2
    nsum %= x
    cans = bin(nsum).count("1")
    if cans == 0:
        return 1
    else:
        return 1 + func(bin(nsum))

for i in range(a):
    s = list(b)
    s[i] = "0" if s[i] == "1" else "1"
    c = "".join(s)
    print(str(func(c)))

### FIXED CODE ###

from functools import lru_cache


a = int(input())
b = input()
X = b.count("1")
ans1 = []
ans2 = []

@lru_cache(maxsize=None)
def func1(c):
    x = X + 1
    n = 1
    nsum = 0
    for i in reversed(range(len(c))):
        ans1.append(n)
        nsum += n * int(c[i])
        n = n % x if n > x else n
        n *= 2
    return nsum
    
@lru_cache(maxsize=None)
def func2(c):
    x = X - 1
    if x == 0:
        return 0
    n = 1
    nsum = 0
    for i in reversed(range(len(c))):
        ans2.append(n)
        nsum += n * int(c[i])
        n = n % x if n > x else n
        n *= 2
    return nsum    

def func(c):
    x = c.count("1")
    if x == 0:
        return 0
    n = 1
    nsum = 0
    for i in reversed(range(len(c))):
        nsum += n * int(c[i])
        n = n % x if n > x else n
        if n == 0:
            break
        n *= 2
    nsum %= x
    cans = bin(nsum).count("1")
    if cans == 0:
        return 1
    else:
        return 1 + func(bin(nsum)[2:])
    
allans1 = func1(b)
allans2 = func2(b)
ans1 = ans1[::-1]
if allans2 == 0:
    ans2 = [0] * a
else:
    ans2 = ans2[::-1]

c = list(b)
for i in range(a):
    if c[i] == "0":
        ans = (allans1 + ans1[i]) % (X + 1)
        ans = func(bin(ans)[2:]) + 1
        print(str(ans))
    else:
        if allans2 - ans2[i] == 0 and X - 1 == 0:
            print("0")
        else:
            ans = (allans2 - ans2[i]) % (X - 1)
            ans = func(bin(ans)[2:]) + 1
            print(str(ans))
import sys
sys.setrecursionlimit(10**7)
n,k = map(int, input().split())
a = []
for i in range(n):
    a.append(int(input()))
a.reverse()
# dp[i] := i番目の数字から始めたときの最大値
dp = [0 for i in range(n)]
#####segfunc######
def segfunc(x,y):
    return max(x,y)

def init(init_val):
    #set_val
    for i in range(len(init_val)):
        seg[i+num-1]=init_val[i]   
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
    
def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
    
def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res,seg[p])
        if q&1 == 1:
            res = segfunc(res,seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res,seg[p])
    else:
        res = segfunc(segfunc(res,seg[p]),seg[q])
    return res

#####単位元######
ide_ele = 0
num =2**(n-1).bit_length()
seg=[ide_ele]*(2*num - 1)
#阪堺区間に注意
dp[0] = 1
update(a[0], 1)
max_a = max(a) + 1
for i in range(1,n):
    # print("{} {}".format(max(a[i]-k, 0), min(max_a, a[i]+k+1)))
    dp[i] = query(max(a[i]-k, 0), min(max_a, a[i]+k+1)) + 1
    update(a[i], dp[i])
print(max(dp))

### FIXED CODE ###


n,k = map(int, input().split())
a = []
for i in range(n):
    a.append(int(input()))
a.reverse()
# dp[i] := i番目の数字から始めたときの最大値
dp = [0 for i in range(n)]
#####segfunc######
def segfunc(x,y):
    return max(x,y)

def init(init_val):
    #set_val
    for i in range(len(init_val)):
        seg[i+num-1]=init_val[i]   
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
    
def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
    
def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res,seg[p])
        if q&1 == 1:
            res = segfunc(res,seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res,seg[p])
    else:
        res = segfunc(segfunc(res,seg[p]),seg[q])
    return res

max_a = 300020
#####単位元######
ide_ele = 0
num =2**(max_a-1).bit_length()
seg=[ide_ele]*(2*num - 1)
#阪堺区間に注意
dp[0] = 1
update(a[0], 1)
for i in range(1,n):
    # print("{} {}".format(max(a[i]-k, 0), min(max_a, a[i]+k+1)))
    dp[i] = query(max(a[i]-k, 0), min(max_a, a[i]+k+1)) + 1
    update(a[i], dp[i])
print(max(dp))
n = input()
R = []
for i in irange(n):
   R.append(int(raw_input()))

maxv = R[1] - R[0]
minv = R[0]

for v in range(1, n-1):
   if minv > R[v]:
      minv = R[v]
   if maxv < R[v] - minv:
      maxv = R[v] - minv
print maxv   

### FIXED CODE ###

n = input()
R = []
for i in range(0, n):
   R.append(int(raw_input()))

maxv = R[1] - R[0]
minv = R[0]

for v in range(1, n):
   if minv > R[v]:
      minv = R[v]
   elif maxv < R[v] - minv:
      maxv = R[v] - minv
print maxv
import sys
input = sys.stdin.readline
mod = int(1e9+7)
n,k = map(int,input().split())
L=list(map(int,input().split()))

ans = 1

pos = []
neg = []
for i in L:
    if i>=0:
        pos.append(i)
    else:
        neg.append(i)
pos.sort(reverse=True)
neg.sort()
if len(pos) == 0 and k%2!=0:
    for i in range(1,k+1):
        ans*=neg[-i]
        ans%=mod
    print(ans%mod)
    sys.exit()
if k%2!=0:
    ans*=pos.pop(0)
    k-=1
l=[]
for i in range(1,len(pos),2):
    l.append(pos[i]*pos[i-1])

for i in range(1,len(neg),2):
    l.append(neg[i]*neg[i-1])

l.sort(reverse = True)
for i in range(k//2):
    ans*=l[i]
    ans%=mod

print(ans%mod)


### FIXED CODE ###

import sys
input = sys.stdin.readline

h,w,k = map(int,input().split())
M=[input().rstrip() for _ in range(h)]
ans = 0
for ib in range(1<<h):
    for jb in range(1<<w):
        cc = 0 
        for i in range(h):
            if ib&(1<<i):continue
            for j in range(w):
                if jb&(1<<j):continue
                cc+=M[i][j]=='#'
        if cc==k:
            ans+=1
print(ans)
a,b = [int(i) for i in input().split()]
n = b-a-1
print(n*(n+1)/2-a)

### FIXED CODE ###

N = int(input())
if N < 1000:
    print('ABC')
elif N >= 1000:
    print('ABD')
print((int(input())**2)

### FIXED CODE ###

n = int(input())
print(n**2)
n = int(input())

if n %2 ==1:
  print(0)
else:
  mod = 10
  ans = x = n//mod
  
  while(x>0):
    mod *= 5
    x = n//mod
    ans+=x
print(ans)

### FIXED CODE ###

n = int(input())

if n %2 ==1:
  print(0)
else:
  mod = 10
  ans = 0
  x = 0
  while True:
    x = n//mod
    if x==0: break
    ans+=x
    mod *= 5
  print(ans)
gets
$<.map{|l|n=0.0;b=l.hex;31.times{|i|n+=(2**(24-i))*b[i]};p n*(-1)**b[31]}

### FIXED CODE ###

for i in range(input()):    
	b=int(raw_input(),16)
	s=1<<31
	p=""
	if b&s!=0:
		b^=s
		p="-"
	a=int(b*1.0/(1<<7))
	print p+str(a)+str(abs(b*1.0/(1<<7)-a))[1:]
d, n = map(int, input().split())
    if d == 0:
      if n == 100:
        print(101)
      else:
        print(n)
    else:
      if n == 100:
      	print(100**d * n)
      else:
        print(100**d * 101)

### FIXED CODE ###

a, b = map(int, input().split())
if a <= 8 and b <= 8:
	print("Yay!")
else:
	print(":(")
N = int(input())
A = []

for _ in range(N):
    a = int(input())
    xy = []
    for _ in range(a):
        x, y = map(int, input().split())
        xy.append((x, y))
    A.append(xy)

ans = 0
cnt = 0
bit = format(cnt, "#015b")
for _ in range(2 ** N):
    d = {}
    for i in range(N):
        d[i] = int(bit[-i])

    flag = False
    for i in range(N):
        for x, y in A[i]:
            if d[i] == 1:
                if d[x - 1] == y:
                    pass
                else:
                    flag = True
                    break
            else:
                if d[x - 1] == y:
                    flag = True
                    break
                else:
                    pass

        if flag:
            break

    if flag:
        cnt += 1
        bit = format(cnt, "#015b")
        continue

    a = sum(list(map(int, list(bit[2:]))))
    ans = max(a, ans)
    cnt += 1
    bit = format(cnt, "#015b")


print(ans)


### FIXED CODE ###

def is_nth_bit_set(x, n):
    if x & (1 << n):
        return 1
    else:
        return 0


N = int(input())
comment = {}
for i in range(N):
    A = int(input())
    comment[i] = []
    for _ in range(A):
        x, y = map(int, input().split())
        x -= 1
        comment[i].append((x, y))

ans = 0
for i in range(2 ** N):
    judge = [None] * N
    flag = True
    for j in range(N):
        honest = is_nth_bit_set(i, j)
        judge[j] = honest

    for j in range(N):
        honest = judge[j]
        if not honest:
            continue
        for x, y in comment[j]:
            if honest:
                if judge[x] == y:
                    continue
                else:
                    flag = False
                    break
    if not flag:
        continue

    tmp = sum(judge)
    if tmp > ans:
        ans = tmp
print(ans)
while True:
	li= list(map(int, input().split())
	li.sort()
	if li =[0,0]:
		break
	print(*li)


### FIXED CODE ###

while True:
	x,y=sorted(map(int,input().split()))
	if x==0 and y==0:
		break
	print(x, y)
N,K= map(int,input().split())
d1=int(input())
Ad1 = list(map(int,input().split()))
d2=int(input())
Ad2 = list(map(int,input().split()))
okashi=[0]*N
for i in Ad1:
    okashi[i-1]+=1
for i in Ad2:
    okashi[i-1]+=1
count=0
for i in okashi:
    if i==0:
        count+=1
print(count)

### FIXED CODE ###

N,K= map(int,input().split())
okashi=[0]*N

for i in range(K):
    d=int(input())
    Ad = list(map(int,input().split()))
    for j in Ad:
        okashi[j-1]+=1
count=0
for i in okashi:
    if i==0:
        count+=1
print(count)
import collections
n=int(input())
li=[]
for i in range(n):
    s=str(input())
    li.append(s)
li.sort(reverse=True)
c=collections.Counter(li)
print(c.most_common()[0][0])
for i in range(1,n):
    if c.most_common()[i][1]==c.most_common()[0][1]:
        print(c.most_common()[i][0])
    else:
        break
        
    
    



    

### FIXED CODE ###

import collections
n=int(input())
li=[input() for _ in range(n)]
c=collections.Counter(li)
M=max(c.values())
ans=[]
for k,v in c.items():
    if v==M:
      ans.append(k)
ans.sort()
for i in range(len(ans)):
  print(ans[i])
mod = 10 ** 9 + 7
import copy
cc = copy.deepcopy(c)
color_sum = {i: 0 for i in range(10 ** 6)}
dp = [1 for _ in range(n)]
color_sum[cc[0]] = 1
for i in range(1, n):
    dp[i] = dp[i - 1]
    if cc[i - 1] == cc[i]:
        continue
    dp[i] += color_sum[cc[i]]
    dp[i] %= mod
    color_sum[c[i]] += dp[i]
    color_sum[c[i]] %= mod
print(dp[n - 1])

### FIXED CODE ###

mod = 10 ** 9 + 7
n = int(input())
c = [int(input()) for _ in range(n)]
import copy
cc = copy.deepcopy(c)
color_sum = {i: 0 for i in range(10 ** 6)}
dp = [1 for _ in range(n + 1)]
color_sum[cc[0]] = 1
for i in range(2, n + 1):
    dp[i] = dp[i - 1]
    if cc[i - 2] == cc[i - 1]:
        continue
    dp[i] += color_sum[cc[i - 1]]
    dp[i] %= mod
    color_sum[c[i - 1]] += dp[i - 1]
    color_sum[c[i - 1]] %= mod
print(dp[n])
int(input())
I = sorted(map(int, input().split()))
minX = 1000000
for i in range(len(I)):
  minX = min(minX, abs(sum(I[:-i]) - sum(I[-i:]) ) )
  
print(minX)

### FIXED CODE ###

N = int(input())
I = list(map(int, input().split()))
minX = 10000000000
end = I.pop()
sumI = sum(I)
for i in range(len(I)):
  minX = min(minX, abs(sumI - end ) )
  popped = I.pop()
  sumI -= popped
  end += popped
  
print(minX)
n = int(input())

G = {}
for i in range(n):
    G.update({i: []})

for i in range(n - 1):
    u, v, w = map(int, input().split())
    G[u - 1].append([v - 1, w % 2])
    G[v - 1].append([u - 1, w % 2])

color = [-1 for i in range(n)]

def dfs(graph, v, c):
    color[v] = c
    
    for next_v in graph[v]:
        dis = next_v[1]
        if color[next_v[0]] != -1:
            continue
        
        if dis == 0:
            n_c = c
        elif dis == 1:
            n_c = 1 - c
        
        dfs(graph, next_v[0], n_c)

dfs(G, 0, 0)
[print(i) for i in color]


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

n = int(input())
 
G = {}
for i in range(n):
    G.update({i: []})
 
for i in range(n - 1):
    u, v, w = map(int, input().split())
    G[u - 1].append([v - 1, w % 2])
    G[v - 1].append([u - 1, w % 2])
 
color = [-1 for i in range(n)]
 
def dfs(graph, v, c):
    color[v] = c
    
    for next_v in graph[v]:
        dis = next_v[1]
        if color[next_v[0]] != -1:
            continue
        
        if dis == 0:
            n_c = c
        elif dis == 1:
            n_c = 1 - c
        
        dfs(graph, next_v[0], n_c)
 
dfs(G, 0, 0)
[print(i) for i in color]
n=int(input())
l=list(map(int, input().split()))
m=0
for i in range(n):
  for j in range(i):
    if l[j]>l[i]:
      break
  else:
    m+=1
print(m)

### FIXED CODE ###

a, b=map(int, input().split())
if (a-1)>=b:
  print(a*2-1)
elif a==b or a==b:
  print(a+b)
else:
  print(b*2-1)
s = input()
check = 0
if s[0] == "A":
  if s[2:len(s)-1].count("C") == 1:
    if s[1].lower() == s[1] and s[len(s)-1].lower() == s[len(s)-1]:
      s.lstrip("C")
      if s[1:len(s)].lower() == s[1:len(s)]:
        check = 1
        
if check = 0:
  print("WA")
else:
  print("AC")
      
    
    
    

### FIXED CODE ###

s = input()
check = 0
if s[0] == "A":
  if s[2:len(s)-1].count("C") == 1:
    if s[1].lower() == s[1] and s[len(s)-1].lower() == s[len(s)-1]:
      t = s.replace("C","")
      if t[1:len(s)].lower() == t[1:len(s)]:
        check = 1
        
if check == 0:
  print("WA")
else:
  print("AC")
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
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)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def dist(p1, p2):
	p1 = np.array(p1)
	p2 = np.array(p2)
	return np.linalg.norm(p1-p2)

N = INT()
xy = [LIST() for _ in range(N)]

distance = 0
cnt = 0

for p in permutations(xy, N):
	cnt += 1
	for i in range(N-1):
		distance += dist(p[i], p[i+1])

print(distance/cnt)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
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

def dist(p1, p2):
	return sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2)

N = INT()
xy = [LIST() for _ in range(N)]

distance = 0
cnt = 0

for p in permutations(xy, N):
	cnt += 1
	for i in range(N-1):
		distance += dist(p[i], p[i+1])

print(distance/cnt)
values = [int(input()) for i in range(int(input()))]
maxv = -1000000
minv = values[0]

for val in enumerate(values):
    maxv = max(maxv, (val - minv))
print(maxv)


### FIXED CODE ###

values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)
a = input()
b = input()
print a*b

### FIXED CODE ###

xs = map(int,raw_input().split())
a = xs[0]
b = xs[1]
print a*b, 2*(a+b)
D,G = list(map(int,input().split()))
pc = [[i]+list(map(int,input().split())) for i in range(D)]

for i,row in enumerate(pc):
    s = (i+1)*row[1] * 100 + row[2]
    ave = s/row[1]
    pc[i].append(s)
    pc[i].append(ave)

out = 0
while 1:
    check=False
    i_list = []
    for i,row in enumerate(pc):
        if G<row[3]:
            check=True
            i_list.append(i)
    if check == False:
        #どれをコンプリートしても目標を超えない
        #問題数当たり平均が最高の問題セットを解く
        tmp = [row[4] for row in pc]
        i = tmp.index(max(tmp))
        out += pc[i][1]
        G -= pc[i][3]
        pc.pop(i)
    else:
        #どれかをコンプリートすると目標を達成
        #最小問題数のセット または 最高得点問題での必要数
        tmp = [pc[i][1] for i in i_list]
        m = min(tmp)
        if pc[-1][3] > G:
            m = min(m,G//((pc[-1][0]+1)*100))
        out += m
        break
print(out)

### FIXED CODE ###

D,G = list(map(int,input().split()))
pc = [list(map(int,input().split())) for i in range(D)]

ans = sum([p for p,c in pc])
for i in range(2**D-1):
    score = 0
    unused_max = D-1
    sum_p = 0
    for j in range(D-1,-1,-1):
        if (i>>j)%2:
            score += pc[j][1] + pc[j][0]*(j+1)*100
            sum_p += pc[j][0]
            if unused_max == j:
                unused_max -= 1
    if G - score <= (pc[unused_max][0]-1)*(unused_max+1)*100:
        ans = min(ans,sum_p+max(0,(G-score-1)//(100*(unused_max+1))+1))
print(ans)
import itertools
import copy
n=int(input())
c=0
A=[]
for i in range(2,int(n**0.5+1)):
  if n%i==0:
    a=0
    while(n%i==0):
      n//=i
      a+=1
    A.append(a)
l=len(A)
i=1
while(sum(A)>=l and l>0):
  for j in itertools.combinations_with_replacement(range(l), i):
    for k in j:
      C=deepcopy(A)
      if A[k]==0:
        A[k]=C[k]
        break
      else:
        A[k]-=1
    else:
      c+=1
  B=[]
  for a in A:
    if a!=0:
      B.append(a)
  A=B
  l=len(A)
  i+=1
print(1 if c!=1 and c==0 else c)

### FIXED CODE ###

a,n=0,int(input())
for i in range(2,int(n**0.5+1)):
  x=0
  while(n%i==0):n//=i;x+=1
  j=1
  while(x>=j):a+=1;x-=j;j+=1
print(a+(n>1))
mod = 1000000007
factorial = [1]
for n in range(1, H+W):
    factorial.append(factorial[n-1]*n%mod)
def power(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x % mod
    elif y % 2 == 0:
        return power(x, y/2)**2%mod
    else:
        return power(x, y/2)**2*x%mod

inverseFactorial = [0] * (H+W)
inverseFactorial[H+W-1] = power(factorial[H+W-1], mod-2)
for n in range(H+W-2, -1, -1):
    inverseFactorial[n] = inverseFactorial[n+1] * (n+1) % mod
def combi(n, m):
    return factorial[n] * inverseFactorial[m] *inverseFactorial[n-m]%mod

H, W, A, B = map(int, input().split())
answer = 0
for i in range(B+1, W+1):
    answer = (answer + combi(H-A-2+i, i-1)*combi(A+W-i-1,W-i)) % mod
print(answer)

### FIXED CODE ###

H, W, A, B = map(int, input().split())
answer = 0
mod = 1000000007
factorial = [1]
for n in range(1, H+W):
    factorial.append(factorial[n-1]*n%mod)
def power(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x % mod
    elif y % 2 == 0:
        return power(x, y//2) ** 2 % mod
    else:
        a = power(x, y//2) ** 2
        return a * x % mod
inverseFactorial = [0] * (H+W)
inverseFactorial[H+W-1] = power(factorial[H+W-1], mod-2)
for n in range(H+W-2, -1, -1):
    inverseFactorial[n] = inverseFactorial[n+1] * (n+1) % mod
def combi(n, m):
    return factorial[n] * inverseFactorial[m] *inverseFactorial[n-m]%mod

for i in range(B+1, W+1):
    answer = (answer + combi(H-A-2+i, i-1)*combi(A+W-i-1,W-i)) % mod
print(answer)
A,B,C,K = map(int,input().split())

ls = [1] * A + [0] * B + [-1] * C

print(sum(ls[:K]))

### FIXED CODE ###

A,B,C,K = map(int,input().split())
 
if K <= A:
  print(K)
elif K <= (A+B):
  print(A)
else:
  print(A-(K-(A+B)))
A = map(int, input().split())
print(sum(A)-max(A))

### FIXED CODE ###

A = list(map(int, input().split()))
print(sum(A)-max(A))