Harryxun/stf_run huggingface dataset:
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
i = 0
while D <= X:
    D = (D + L[i])
    i += 1
print(i)


### FIXED CODE ###

import sys
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
i = 0
while D <= X:
    D = (D + L[i])
    i += 1
    if i == N and D <= X:
        print(i+1)
        sys.exit()
print(i)
from collections import Counter
n = int(input())
ss = [sorted(input()) for i in range(n)]
dic = Counter(ss)
cnt=0
for k, v in dic:
  cnt += v
print(cnt)

### FIXED CODE ###

from collections import Counter
n=int(input())
string_list=["".join(sorted(list(input()))) for i in range(n)]
counter=Counter(string_list)
cnt=0
for k, v in counter.items():
  cnt+=int(v*(v-1)/2)
print(cnt)
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
lst = []
for i in range(M):
    A = list(map(int,input().split()))
    lst.append(A[i]*B[i])
for i in lst:
    if i > 0:
      ans += 1
print(ans)

### FIXED CODE ###

N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
total = 0
lst = []
for i in range(N):
  A = list(map(int,input().split()))
  for j in range(M):
    total += A[j]*B[j]
  lst.append(total)
  total = 0
for i in lst:
    if i +C > 0:
      ans += 1
print(ans)
S, T = input.split()
a, b = map(int, input.split())
s = input()
if s == S:
  print(a-1, b)
else:
  print(a, b-1)


### FIXED CODE ###

import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial

sys.setrecursionlimit(10**7)
S, T = input().split()
A, B = map(int, input().split())
s = input()

if s == S:
    print(A-1, B)
else:
    print(A, B-1)
import sys
n, k = map(int, input().split())
a = list(map(int, input().split())) 

visited = [None]*n
cur = 0
for i in range(k):
    if visited[cur] is None:
        visited[cur] = i
        cur = a[cur]-1
    else:
        break
else:
    print(cur+1)
	sys.exit()

k -= i
k %= i-visited[cur]

for i in range(k):
    cur = a[cur]-1

print(cur+1)

### FIXED CODE ###

s = str(input())
t = str(input())
ans = True
for i in range(len(s)):
    if s[i] == t[i]:
        continue
    else:
        ans =False
if len(s) != len(t)-1:
    ans = False

if ans:
    print("Yes")
else:
    print("No")
a, b, c = map(int, input().split())
if a+b => c:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

a,b,c = map(int, input().split())
if a + b < c:
    print("No")
else:
    print("Yes")
A,B = map(int, input().split())
cnt = 0
for i in range(A,B+1):
    if str(i) == str(i).reverse():
        cnt += 1
print(cnt)

### FIXED CODE ###

A,B = map(int, input().split())
cnt = 0
for i in range(A,B+1):
    if str(i) == (str(i))[::-1]:
        cnt += 1
print(cnt)
n, m = map(int, input().split())
ans = [-1]*n

if n = 1 and m = 0:
    print(0)
    exit()

for i in range(m):
    s, c = map(int, input().split())

    if s == 1 and c == 0:
        print(-1)
        exit()
        
    if ans[s-1] == -1 or ans[s-1] == c:
        ans[s-1] = c
    else:
        print(-1)
        exit()

if ans[0] == -1:
    ans[0] = 1

for i in range(n):
    if ans[i] == -1:
        ans[i] = 0

print(*ans, sep="")

### FIXED CODE ###

n, m = map(int, input().split())
ans = [-1]*n

for i in range(m):
    s, c = map(int, input().split())
    if s == 1 and c == 0 and n != 1:
        print(-1)
        exit()
    if ans[s-1] == -1 or ans[s-1] == c:
        ans[s-1] = c
    else:
        print(-1)
        exit()

if ans[0] == -1 and n != 1:
    ans[0] = 1

for i in range(n):
    if ans[i] == -1:
        ans[i] = 0

print(*ans, sep="")
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()
	A = inputList()

	to = 0
	for i in A:
		to += i

	to = t0 // 2
	to1 = 0
	to2 = 0

	toto = 0
	for i in A:
		if to1 >= to:
			to2 += i
		else:
			to1 += i

	ans = abs(to1-to2)


if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()
	A = inputList()

	to = 0
	for i in A:
		to += i

	to = to // 2
	manaka = 0
	tmp = 0
	for i,val in enumerate(A):
		tmp += val
		if tmp >= to:
			manaka = i
			break

	#print(to)
	#print(manaka)

	to1 = 0
	to11 = 0
	to2 = 0
	to22 = 0

	to111 = 0
	to222 = 0

	for i,val in enumerate(A):
		if i >= manaka+1:
			to2 += val
		else:
			to1 += val

		if i >= manaka-1:
			to22 += val
		else:
			to11 += val

		if i >= manaka:
			to222 += val
		else:
			to111 += val

	ans = min(abs(to1-to2),abs(to11-to22),abs(to111-to222))
	print(ans)


if __name__ == "__main__":
	main()
import numpy as np

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

s = B-1 if N > B-1 else N

x = np.arange(0, s+1)
X = A * (x % B) - (A * (x % B)) % B

print(int(np.max(X)))

### FIXED CODE ###

# -*- coding: utf-8 -*-
A,B,N = map(int, input().split())
 
def function(x):
  return (A*x)//B-A*(x//B)
 
if B-1<=N:
  print(function(B-1))
else:
  print(function(N))
s=input()
mod = 1000000007
 
dp = [[0 for l in range(13)] for m in range(len(s)+1)]
dp[0][0] = 1
for i in range(1,len(s)+1):
  p = 10**(int((i-1)%12))%13
  if s[-i] == '?':
    for j in range(10):
      for k in range(13):
        dp[i][(k+j*p)%13] += dp[i-1][k]
        dp[i][(k+j*p)%13] %mod
  else:
    for k in range(13):
      dp[i][(int(s[-i])*p +k)%13] += dp[i-1][k]
      dp[i][(int(s[-i])*p +k)%13] %mod
 
print(dp[len(s)][5] %mod)

### FIXED CODE ###

A, B = map(int, input().split())
if A == 0 or B == 0 or (A + B)%2 ==1:
	print('IMPOSSIBLE')
else:
  print(int((A + B)/2))
s,t = input(), split()
a = 0
for i in range(len(s)):
    if s[i]==t[i]:
        a = a + 1
    else:
        a = a + 0
print(a)


### FIXED CODE ###

s,t = input(), input()
a = 0
for i in range(len(s)):
    if s[i]!=t[i]:
        a = a + 1
print(a)
while True:
    n,m = map(int,raw_input().split())
   

### FIXED CODE ###

while True:
    try:
        n,m = list(map(int,input().split()))
        if n == 0 and m == 0:
            break
        amari = n % m
        yasai = list(map(int,input().split())) 
        yasai.sort()

        s = 0
        for i in range(n):
            if (i+1) % m > 0:
                s += yasai[-i-1]
        print(s)
    except:
        pass
d = [2,5,5,4,5,6,3,7,6]

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

memo = [ "-" for _ in range(N + 1)]

def find(N):
    global memo
    if memo[N] != "-":
        return memo[N]

    mval = ""
    val = ""
    for a in A:
        if d[a - 1] < N:
            val = str(find(N - d[a - 1]))
            if val == "":
                continue
            val = val + str(a)
        elif d[a - 1] == N:
            val = str(a)

        if len(mval) < len(val) or mval < val:
            mval = val
    memo[N] = mval
    return memo[N]

m = find(N)
print(m)


### FIXED CODE ###

import sys
sys.setrecursionlimit(150000)


d = [2,5,5,4,5,6,3,7,6]

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

memo = [ "-" for _ in range(N + 1)]

def find(N):
    global memo
    if memo[N] != "-":
        return memo[N]

    mval = ""
    val = ""
    for a in A:
        if d[a - 1] < N:
            val = find(N - d[a - 1])
            if val == "":
                continue
            val = val + str(a)
        elif d[a - 1] == N:
            val = str(a)
        else:
            continue

        if len(mval) < len(val) or (len(mval) == len(val) and mval < val):
            mval = val
    memo[N] = mval
    return memo[N]

m = find(N)
print(m)
C

### FIXED CODE ###

in_list = list(map(int, input().split()))
for i in range(5):
  if in_list[i] ==0:
    print(i+1)
a,b=map(str,input().split())
ab:str=""
ba:str=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(ab>ba):
    print(ba)
elif(ab==ba):
    print(ab)
else:
    print(ab)

### FIXED CODE ###

a,b=map(str,input().split())
ab=""
ba=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(ab>ba):
    print(int(ba))
elif(ab==ba):
    print(int(ab))
else:
    print(int(ab))
import math
N, P = map(int, input().split())
p = math.ceil(P**(1/N))
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)

divisors=[]
for i in range(1,p+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)


### FIXED CODE ###

import math
N, P = map(int, input().split())
p = P**(1/N)
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


divisors=[]

for i in range(2,round(P**(1/N))+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)
import sys
sys.setrecursionlimit(4100000)
import heapq
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
f = [int(i) for i in input().split()]
a.sort()
f.sort(reverse=True)

if sum(a) <= k:
    print(0)
else:
    heap = []
    for i in range(n):
        heapq.heappush(heap, (-a[i]*f[i], a[i], f[i]))
    for i in range(k):
        cur,x,y = heapq.heappop(heap)
        x -= 1
        cur = x*y
        heapq.heappush(heap,(-cur,x,y))
    ans = -float('inf')
    for i in range(len(heap)):
        ans = max(-heap[i][0], ans)
    print(ans)

### FIXED CODE ###

a, b = [int(i) for i in input().split()]
if a <= 9 and b <= 9:
    print(a*b)
else:
    print(-1)
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.append(0)
h.sort()
for i in range(k):
  h.pop(-1)
print(sum(h))

### FIXED CODE ###

n,k=map(int,input().split())
if n<k:
  k=n
h=list(map(int,input().split()))
h.append(0)
h.sort()
for i in range(k):
  h.pop(-1)
print(sum(h))
#grab
e=int(input())
while e>0:
    z=0
    while z**3<=e 
        z+=1
    z-=1
    e-=z**3
    y=0
    while y*y<=e:
        y+=1
    y-=1
    e-=y*y
    e+=y+z
    print(e)
    e=int(input())

### FIXED CODE ###

# your code goes here
#grab
import math
e=int(input())
#e=1250
while e>0:
    z=0
    t=z**3
    f=e-t
    q=math.sqrt(f)
    y=int(q)
    if q-y>0.999999:
        y+=1
    x=y*y
    x=f-x
    m=x+y+z
    while t<=e:
        f=e-t
        q=math.sqrt(f)
        y=int(q)
        if q-y>0.999999:
            y+=1
        x=y*y
        x=f-x
        l=x+y+z
        if l<m:
            m=l
        z+=1
        t=z**3
    print(m)
    e=int(input())
from copy import deepcopy
N=int(input())
A=list(map(int,input().split()))
K=deepcopy(A)
A.sort()
ans=10**(-20)
S=sum(A)
for i in range(N-1):
    S=S-A[i]+(-A[i])
    if ans<S:
        ans=S
        j=i
print(ans)
for i in range(j+1,N-1):
    print(A[0],A[i])
    A[0]-=A[i]
print(A[N-1],A[0])


### FIXED CODE ###

from copy import deepcopy
N=int(input())
A=list(map(int,input().split()))
if N==2:
    print(max(A[0]-A[1],A[1],A[0]))
    print(max(A[0],A[1]),min(A[0],A[1]))
    quit()
A.sort()
ans=10**(-50)
S=sum(A)
for i in range(N-1):
    S=S-A[i]+(-A[i])
    if ans<S:
        ans=S
        j=i
print(ans)
for i in range(j+1,N-1):
    print(A[0],A[i])
    A[0]-=A[i]
for i in range(j+1):
    print(A[N-1],A[i])
    A[N-1]-=A[i]
N = int(input())
a = list(map(int, input().split()))

from collections import deque
kisuu = deque([])
bai4 = deque([])
sonota = deque([])
for ai in a:
    if ai % 4 == 0:
        bai4.append(ai)
    elif ai % 2 == 0:
        sonota.append(ai)
    else:
        kisuu.append(ai)

ans = deque([])
if kisuu:
    s = kisuu.pop()
    ans.append(s)
elif sonota:
    s = sonota.pop()
    ans.append(s)
else:
    s = bai4.pop()
    ans.append(s)        

for i in range(1, N + 1):
    if i == N:
        print('Yes')
        quit()
    if ans[i - 1] % 2 == 1:
        if bai4:
            s = bai4.pop()
            ans.append(s)
        else:
            break
    elif ans[i - 1] % 2 == 2 and ans[i - 1] % 4 != 0:
        if sonota:
            s = sonota.pop()
            ans.append(s)
        elif bai4:
            s = sonota.pop()
            ans.append(s)
        else:
            break
    else:
        if kisuu:
            s = kisuu.pop()
            ans.append(s)
        elif sonota:
            s = sonota.pop()
            ans.append(s)
        elif bai4:
            s = sonota.pop()
            ans.append(s)
        else:
            break
print('No')           

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
from collections import deque
kisuu = deque([])
bai4 = deque([])
sonota = deque([])
for ai in a:
    if ai % 4 == 0:
        bai4.append(ai)
    elif ai % 2 == 0:
        sonota.append(ai)
    else:
        kisuu.append(ai)

ans = deque([])
if kisuu:
    s = kisuu.pop()
    ans.append(s)
elif sonota:
    s = sonota.pop()
    ans.append(s)
else:
    s = bai4.pop()
    ans.append(s)        

for i in range(1, N + 1):
    if i == N:
        print('Yes')
        quit()
    if ans[i - 1] % 2 == 1:
        if bai4:
            s = bai4.pop()
            ans.append(s)
        else:
            break
    elif ans[i - 1] % 2 == 0 and ans[i - 1] % 4 != 0:
        if sonota:
            s = sonota.pop()
            ans.append(s)
        elif bai4:
            s = bai4.pop()
            ans.append(s)
        else:
            break
    elif ans[i - 1] % 4 == 0:
        if kisuu:
            s = kisuu.pop()
            ans.append(s)
        elif sonota:
            s = sonota.pop()
            ans.append(s)
        elif bai4:
            s = bai4.pop()
            ans.append(s)
        else:
            break
print('No')
def main():
    N = int(input())
    A = []
    B = []
    b_max = 0
    for _ in range(N):
        a, b = map(int, input().split(" "))
        A.append(a)
        B.append(b)
        if b_max < b:
            b_max = b
    tasks = [0] * (b_max + 1)
    for i in range(N):
        tasks[B[i]] += A[i]
    time = 0
    flag = True
    for i, task in enumerate(tasks):
        if i == 0:
            continue
        time += task
        if time > i:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N = int(input())
    flag = True
    tascs = []
    for _ in range(N):
        a, b = map(int, input().split(" "))
        tmp = [a, b]
        tascs.append(tuple(tmp))
    tascs.sort(key=lambda x: x[1])
    passed_time = 0
    for tasc in tascs:
        passed_time += tasc[0]
        if passed_time > tasc[1]:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
s=input()
K=int(input())
 
ans=[]
ans.append(s)
 
 
for i in range(len(s)-1):
 for j in range(i+1):
  cut_s=s[j:j+len(s)-i-1]
  if cut_s not in ans:
   ans.append(cut_s)
   ans.sort()
  if len(ans)>K:
    ans.pop()
 
answer=ans[K-1]
print(answer)

### FIXED CODE ###

s=input()
K=int(input())
 
ans=[]
ans.append(s)
 
 
for i in range(len(s)):
 for j in range(len(s)-i):
  cut_s=s[i:i+j+1]
  ans.append(cut_s)
  ans=sorted(set(ans))
  if len(ans)>K:
   if cut_s==ans[K]:
     ans.pop()
     break;
   ans.pop()
 
answer=ans[K-1]
print(answer)
N,W = map(int,input().split())
w = []
v = []
for i in range(n):
    a,b = map(int,input().split())
    w.append(a)
    v.append(b)
dp = [0] * (W+1)

for i in range(N):
    tmp_w = w[i]
    tmp_v = v[i]
    for j in range(W):
        if dp[j] != 0:
            if j + tmp_w <= W:
                if dp[j + tmp_w] < tmp_v:
                    dp[j + tmp_w] = dp[j] + tmp_v
    if dp[tmp_w] < tmp_v:
        dp[tmp_w] = tmp_v
print(max(dp))

### FIXED CODE ###

N,W = map(int,input().split())
w, v = zip(*(map(int, input().split()) for _ in range(N)))

dp = [0] * (W+1)

for i in range(N):
    for j in range(W,0,-1):
        if j - w[i] >= 0 and dp[j] < dp[j - w[i]] + v[i]:
            dp[j] = dp[j - w[i]] + v[i] #jは重さ、w[i]も重さ、dp[j]は重さjの時の価値、v[i]は重さw[i]の時の価値
    if dp[w[i]] == 0 or dp[w[i]] < v[i]:
        dp[w[i]] = v[i]
print(max(dp))
N = int(input())
pre = list(range(1,N+1))
new = pre[:]
a0 = new[0]
new.remove(a0)
new.append(a0)

val = 0
for i in range(N):
    val += pre[i] % new[i]

print(val)

### FIXED CODE ###

N = int(input())
ans = (N * (N - 1)) // 2
print(ans)
import sys

s = input()
t = input()

a = int(len(s))

for i in range(0,a) :
    s = s[:a-1:]+s[a-1::]
    if s == t :
        print("Yes")
        sys.exist()

print("No")

### FIXED CODE ###

import sys

s = input()
t = input()

a = int(len(s))

for i in range(0,a) :
    s = s[a-1::]+s[:a-1:]
    if s == t :
        print("Yes")
        sys.exit()

print("No")
th, ts, ah,as  = map(int, input().spilt())
turn = 1
#1 represent takashi monster turn
#0 represent aoki monster turn
while(1):
  if(turn):
    ah-=ts
    if(ah<=0):
      print("No")
      break
  else:
    th-=as
    if(th<=0):
      print("Yes")
      break
  turn^=1
 

### FIXED CODE ###

th, tMon, ah, aMon  = map(int, input().split())
turn = 1
#1 represent takashi monster turn
#0 represent aoki monster turn
while(1):
  if(turn):
    ah-=tMon
    if(ah<=0):
      print("Yes")
      break
  else:
    th-=aMon
    if(th<=0):
      print("No")
      break
  turn^=1
a,b,c = *sorted(list(map(int, input().split())))
print(a*10+b+c)

### FIXED CODE ###

a,b,c = sorted(list(map(int, input().split())))
print(c*10+b+a)
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
ans =[0]*n
flag = False
for i in range(m):
    for j in range(m):
        if sc[i][0] == sc[j][0] and sc[i][1] != sc[j][1]:
            flag = True
            break
    else:
        break

for i in range(m):
    ans[sc[i][0]-1] = sc[i][1]

if flag or ans[0] == 0:
    print(-1)
else:
    print(ans[0]*100 + ans[1]*10 + ans[2])

### FIXED CODE ###

n, m = map(int, input().split())
sc = [tuple(map(int, input().split())) for _ in range(m)]

flag = True

if n == 1 and m == 0:
    print(0)
elif n == 1 and m != 0:
    if len(set(sc)) != 1:
        print(-1)
    else:
        print(sc[0][1])
        
        
elif n > 1 and m == 0:
    print(10**(n-1))
    
elif n > 1 and m != 0:
    for i in range(10**(n-1), 10**n):
        i_str = str(i)
        i_list = list(i_str)
        for item in set(sc):
            if i_list[item[0]-1] != str(item[1]):
                break
        else:
            print(i)
            flag = False
            break
    if flag:
        print(-1)
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())

print(-(-a)//(2b+1))

### FIXED CODE ###

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

print(-((-a)//(2*b+1)))
= input()
b = a.split()

if int(b[0]) + int(b[1]) + int(b[2]) >= 22:
    print("bust")
    
else:
    print("win")

### FIXED CODE ###

a = input()
b = a.split()

if int(b[0]) + int(b[1]) + int(b[2]) >= 22:
    print('bust')
    
else:
    print('win')
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
Ar = A[::-1]
Ai = [Ar[i] - A[i] for i in range(N)]
ans = 0

if K > N//2:
    n, r = N-1, K-1 
    C = math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

    for i in range(N-K+1):
        ans += Ai[i] * C
        C *= N-i-K
        if N-i-1 != 0:
            C //= N-i-1
else:
    C = 1
    for i in range(N-K, -1, -1):
        ans += Ai[i] * C
        C *= N - i
        if N-K+1 - i != 0:
            C //= N-K+1 - i

print(ans % 1000000007)

### FIXED CODE ###

N, K = map(int, input().split())
MOD = 10**9+7
A = [a % MOD for a in sorted(list(map(int, input().split())))]
MIN, MAX = 0, 0

def div_MOD(a):     # (a^{-1} mod MOD) をフェルマーの小定理より求める
    return pow(a, MOD - 2, MOD)     # a^{-1} = a^{p-2} (mod p)

C = [0]*(K-1) + [1]
for n in range(K, N):
    C.append((C[n-1] * n * div_MOD(n-(K-1))) % MOD)

for i in range(N-K+1):
    MIN = (MIN + (A[i] * C[N-i-1]) % MOD) %MOD
for i in range(N-K+1):
    MAX = (MAX + (A[N-1-i] * C[N-i-1]) % MOD) %MOD

print((MAX - MIN) % MOD)
x = input(int, )


def func(p):
    q = 1
    while p ** q <= x:
        q += 1
    return p ** (q - 1)


ctn = []
a = 1

while a <= x:
    ctn.append(func(a))
    a += 1

print(max(ctn))


### FIXED CODE ###

x = int(input())

if x == 1:
    print("1")
    exit()


def func(p):
    q = p
    while q < x:
        q *= p
        if q == x:
            return q
    if q / p == p:
        return 1
    else:
        return q // p


z = []
a = 2

while a <= x:
    z.append(func(a))
    a += 1

print(max(z))
N, A, B = map(int, input().split())

counter = [0 for _ in range(N)]
ans = 0
for i in range(N+1):
    st = str(i)
    for j in range(len(st)):
        counter[i] = counter[i] + st[j]
    if A<=counter[i]<=B :
        ans = ans + i

print(ans)

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = 0

for i in range(1, N+1):
    num_sum = 0
    for j in str(i):
        num_sum += int(j)
    if A<= num_sum <= B:
        ans += i

print(ans)
def print_kaijou(k):
    print(str(int(k*(k+1)/2)))

n = int(input())


    
print_kaijou(n-1):


### FIXED CODE ###

n = int(input())
ans = n*(n-1)//2
print(ans)