Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
A = sorted([int(a) for a in input().split()])
C = [0] * 101010
S = [0] * 101010

for a in A[::-1]:
    C[a] += 1
    S[a] += a
for i in range(101000)[::-1]:
    C[i] += C[i+1]
    S[i] += S[i+1]

def cnt(n):
    re = 0
    for a in A:
        re += C[max(n-a, 0)]
    return re
def calc(n):
    re = 0
    for a in A:
        re += S[max(n-a, 0)]  + C[max(n-a, 0)] * a
    return re

l, r = 0, 200001
while r - l > 1:
    m = (l+r) // 2
    if cnt(m) >= M:
        l = m
    else:
        r = m

print(calc(l) - (cnt(l) - M) * l)

### FIXED CODE ###

N, M = map(int, input().split())
A = sorted([int(a) for a in input().split()])
C = [0] * 101010
S = [0] * 101010

for a in A[::-1]:
    C[a] += 1
    S[a] += a
for i in range(101000)[::-1]:
    C[i] += C[i+1]
    S[i] += S[i+1]

def cnt(n):
    re = 0
    for a in A:
        b = min(max(n-a, 0), 101000)
        re += C[b]
    return re
def calc(n):
    re = 0
    for a in A:
        b = min(max(n-a, 0), 101000)
        re += S[b]  + C[b] * a
    return re

l, r = 0, 200001
while r - l > 1:
    m = (l+r) // 2
    if cnt(m) >= M:
        l = m
    else:
        r = m

print(calc(l) - (cnt(l) - M) * l)
N, M = map(int, input().split())
a = list(map(int, input().solit()))

import heapq
a = [-1*i for i in a]
a = heapq.haapify(a)
for i in range(M):
  b = heapq.heappop(a)
  b = (-1*b)//2
  heap.heappush(a, -1*b)
print(-1*sum(a))

### FIXED CODE ###

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

import heapq
a = [-1*i for i in a]
heapq.heapify(a)
for i in range(M):
    b = heapq.heappop(a)
    b = (-1*b)//2
    heapq.heappush(a, -1*b)
print(-1*sum(a))
import sys
for i in sys.stdin:
    a,b,c,d,e,f = map(int, i.split())
    x=(c*e-b*f)/(a*e-b*d)
    y=(f-d*x)/e
    print "%.3f %.3f"%(x,y)

### FIXED CODE ###

import sys
for l in sys.stdin:
    a,b,c,d,e,f=map(float,l.split())
    x=a*e-b*d
    print"%0.3f %0.3f"%(c*e/x-b*f/x,a*f/x-c*d/x)
import math
r = input()
S = r * r * math.pi
l = 2 * math.pi * r

print("{0:.5f}".format(S),"{0:.5f}".format(l))

### FIXED CODE ###

import math
r = float(input(""))
S = r * r * math.pi
l = 2 * math.pi * r
print("{0:.5f} {1:.5f}".format(S, l))
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 19:31:10 2019
ABC118D
@author: maezawa
"""
import copy

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

nmatch = [2,5,5,4,5,6,3,7,6]
rmatch = list(reversed(nmatch))
nmdic = dict([(i+1,nmatch[i]) for i in range(9)])
#nums = [[],[],[1],[7],[4],[2,3,5],[6,9],[8]]
nums = [[] for _ in range(10)]
for  i in a:
    nums[nmdic[i]].append(i)
        
#print(nmdic)
#print(nums)

dp = [[-1,[]] for _ in range(n+1)]
dp[0] = [0, []]
#print(dp)

for i in range(1, n+1):
    cnds = []
    for j in range(2, 8):
        if nums[j] == []:
            continue
        if dp[i-j][0] == -1:
            continue
        cndo = dp[i-j][0]+1
        cndos = copy.copy(dp[i-j][1])
        cndos.append(max(nums[j]))
        cnds.append([cndo, cndos])
        #print(i, i-j, cnds, cndos)
    if cnds == []:
        continue
    dp[i] = max(cnds, key=lambda x: x[0])

ans = ''.join(map(str, sorted(dp[n][1], reverse=True)))
print(ans)



### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 19:31:10 2019
ABC118D
@author: maezawa
"""
import copy

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

nmatch = [2,5,5,4,5,6,3,7,6]
rmatch = list(reversed(nmatch))
nmdic = dict([(i+1,nmatch[i]) for i in range(9)])
#nums = [[],[],[1],[7],[4],[2,3,5],[6,9],[8]]
nums = [[] for _ in range(10)]
for  i in a:
    nums[nmdic[i]].append(i)
        
#print(nmdic)
#print(nums)

dp = [[-1,[]] for _ in range(n+1)]
dp[0] = [0, []]
#print(dp)

for i in range(1, n+1):
    cnds = []
    for k in a:
        j = nmdic[k]
        if i-j < 0:
            continue
        if dp[i-j][0] == -1:
            continue
        cndo = dp[i-j][0]+1
        cndos = copy.copy(dp[i-j][1])
        cndos.append(max(nums[j]))
        cnds.append([cndo, cndos])
        #print(i, i-j, cnds, cndos)
    if cnds == []:
        continue
    dp[i] = max(cnds, key=lambda x: x[0])

ans = ''.join(map(str, sorted(dp[n][1], reverse=True)))
print(ans)
def distribute(n, person, min, max, mode="even"):
    # n 個を person 人に分配する
    # 返り値は [[a (個), a 個もらう人数], ...]
    # 分配できないときは None を返す
    if person==0 and n==0:
        return []
    elif not min*person <= n <= max*person:
        return None
    elif mode=="even":
        q, m = divmod(n, person)
        if m==0:
            return [[q, person]]
        else:
            return [[q, person-m], [q+1, m]]
    elif mode=="greedy":
        n -= min * person
        q, m = divmod(n, max-min)
        if m==0:
            return [[min, person-q], [max, q]]
        else:
            return [[min, person-1-q], [min+m, 1], [max, q]]
    else:
        raise ValueError("'mode' must be 'even' or 'greedy'.")

import numpy as np
N, A, B = map(int, input().split())
Ans = np.arange(N, 0, -1, dtype=np.int64)
Ans[:A] = np.flipud(Ans[:A])
c = N-A
D = distribute(c, B-1, min=1, max=A, mode="greedy")
if D is None:
    print(-1)
    exit()
idx = A
for p, n in D:
    for n_ in range(n):
        Ans[idx:idx+p] = np.flipud(Ans[idx:idx+p])
        idx += p
print(" ".join(str(int(a)) for a in Ans))


### FIXED CODE ###

def distribute(n, person, min, max, mode="even"):
    # n 個を person 人に分配する
    # 返り値は [[a (個), a 個もらう人数], ...]
    if person==0 and n==0:
        return []
    elif not min*person <= n <= max*person:
        return None
    elif mode=="even":
        q, m = divmod(n, person)
        if m==0:
            return [[q, person]]
        else:
            return [[q, person-m], [q+1, m]]
    elif mode=="greedy":
        n -= min * person
        q, m = divmod(n, max-min)
        if m==0:
            return [[min, person-q], [max, q]]
        else:
            return [[min, person-1-q], [min+m, 1], [max, q]]
    else:
        raise ValueError("'mode' must be 'even' or 'greedy'.")

import numpy as np
N, A, B = map(int, input().split())
Ans = np.arange(N, 0, -1, dtype=np.int64)
Ans[:A] = np.flipud(Ans[:A])
c = N-A
D = distribute(c, B-1, min=1, max=A, mode="even")
if D is None:
    print(-1)
    exit()
idx = A
for p, n in D:
    for _ in range(n):
        Ans[idx:idx+p] = np.flipud(Ans[idx:idx+p])
        idx += p
print(" ".join(str(int(a)) for a in Ans))
a

### FIXED CODE ###

S =str(input())
a=S.count("1")
print(a)
# coding: utf-8
import math
import numpy
#N = int(input())
N, K = map(int,input().split())
A = list(map(int,input().split()))
#K =int(input())
ANS = []
a = 1
for i in range(K):
    a *= A[K-i-1]
ANS.append(a)
for i in range(K,N):
    a *=A[i]
    a //= A[i-K]
    ANS.append(a)
#print(ANS)
for i in range(N-K):
    if ANS[i+1] > ANS[i]:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

# coding: utf-8
#import math
#import numpy
#N = int(input())
def main():
    import sys
    input = sys.stdin.readline
    N, K = map(int,input().split())
    A = list(map(int,input().split()))
    #K =int(input())
    ANS = []
    
    #ANS.append(a)
    for i in range(K,N):
        if A[i-K] < A[i]:
            print("Yes")
        else:
            print("No")
        
        
        #ANS.append(a)
    #print(ANS)
    

if __name__ == '__main__':
    main()
s = input()

c = 0
cnt = []
for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        c += 1
    else:
        cnt.append(c)
        c = 0

print(max(cnt))

### FIXED CODE ###

s = input()

cnt = 0
li = []
for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        cnt += 1
    else:
        li.append(cnt)
        cnt = 0

li.append(cnt)
print(max(li))
x,y,z,k=map(int,input().split())
*a,=map(int,input().split())
*b,=map(int,input().split())
*c,=map(int,input().split())
l=[0]*3000
r=[0]*3000
def merge_sort(array):
    if len(array) <= 1:
        return array
    cnt=len(array)//2
    left=array[:cnt]
    right=array[cnt:]
    left = merge_sort(left)
    right = merge_sort(right)
    return merge(left, right)


def merge(left, right):
    array = [0]*3000
    l,r,ind=0,0,0
    if right[0]<left[-1]:
        return left
    while l < len(left) and r < len(right):
        if left[l] >= right[r]:
            array[ind]=left[l]
            l+=1
            ind+=1
        else:
            array[ind]=right[r]
            r+=1
            ind+=1
        if ind>=3000:
            return array
    if l < len(left):
        return array[:ind]+left[l:]
    if r < len(right):
        return array[:ind]+right[r:]

a=merge_sort(a)
b=merge_sort(b)
c=merge_sort(c)
for i in range(y):
    l=merge(l,list(map(lambda w:w+b[i],a)))
for i in range(z):
    r=merge(r,list(map(lambda w:w+c[i],l)))
for i in range(k):
    print(r[i])

### FIXED CODE ###

x,y,z,q=map(int,input().split())
a=sorted(map(int,input().split()),reverse=True)
b=sorted(map(int,input().split()),reverse=True)
c=sorted(map(int,input().split()),reverse=True)
 
def bisect(l,r):
  cnt=(l+r)//2
  if cnt==l:
    return l-1+judge(l)
  if judge(cnt):
    return bisect(cnt+1,r)
  else:
    return bisect(l,cnt)
def judge(thr):
  m=0
  for i in range(x):
    for j in range(y):
      if i*j>q:
        break
      for k in range(z):
        if i*j*k>q or a[i]+b[j]+c[k]<thr:
          break
        m+=1
        if m>=q:
          return True
  return False
def make(thr):
  m=0
  l=[]
  for i in a:
    for j in b:
      for k in c:
        n=i+j+k
        if n<thr+1:
          break
        m+=1
        l+=[n]
  l.sort(reverse=True)
  return l+[thr]*(q-len(l))
thr=bisect(0,a[0]+b[0]+c[0]+1)
ans=make(thr)
for w in ans:
  print(w)
import collections
S = input()
cnt = 0

mod = [0]
reverse_S = S[::-1]
tens = 1
for i in range(len(reverse_S)):
  now = int(reverse_S[i])*tens%2019
  mod.append((now+mod[i])%2019)
  tens *= 10
  tens %= 2019

c = collections.Counter(mod)
hindo = sorted(c.values(),reverse=True)
for i in range(hindo.index(1)):
  n = hindo[i]
  cnt += n*(n-1)/2

print(int(cnt))

### FIXED CODE ###

import collections
S = input()
cnt = 0

mod = [0]
reverse_S = S[::-1]
for i in range(len(reverse_S)):
  now = int(reverse_S[i]) * pow(10,i,2019)
  mod.append((now + mod[i]) % 2019)


c = collections.Counter(mod)
hindo = c.values()
for i in hindo:
  if i != 1:
    cnt += i*(i-1)//2


print(cnt)
def xxx(n):
    ans = ""
    i = 1

    while True:
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans = char(ord("a") + n%26) + ans
                n //= 26
            return ans
        else:
            n -= 26 ** i
            i += 1


N = int(input())
print(xxx(N))

### FIXED CODE ###

def xxx(n):
    alpha = "abcdefghijklmnopqrstuvwxyz"
    ans = ""
    i = 1

    while True:
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans = alpha[n%26] + ans
                n //= 26
            return ans
        else:
            n -= 26 ** i
            i += 1


N = int(input())
print(xxx(N))
n = int(input())
h = [int(i) for i in input().split()]
m = [0]
for i in range(1,n-1):
  if h[i-1] =< h[i] and h[i] >= h[i+1]:
    m.append(h.index(h[i]))
m.append(n-1)
l = [m[i] - m[i-1] for i in range(1,len(m))]
if m == [0,n-1] and h[0] < h[1]:
  print("0")
else:
  print(max(l))


### FIXED CODE ###

n = int(input())
h = [int(i) for i in input().split()]
ans = []
a = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    ans.append(a)
    a = 0
ans.append(a)
print(max(ans))
n = int(input())
s = input()
if s[:int(2/n)] == s[int(2/n):n] :
    print("Yes")
else
    print("No")

### FIXED CODE ###

n = int(input())
s = input()
if s[:int(n/2)] == s[int(n/2):n] :
    print("Yes")
else:
    print("No")
k=int(input())


init=7
for i in range(k+1):
  if init%k ==0:
    print(i+1)
    break
  t = t*10+7
print(-1)

### FIXED CODE ###

x=int(input())

print('Yes') if x>29 else print('No')
def main():
    from fractions import gcd
    import sys
    n=int(input())
    a = tuple(map(int, input().split()))
    ans = a[0]

    #mmm=10**9+7
    for i in a[1:]:
        ans = ans *i // gcd(ans, i)

    result=0
    for item in a:
      resul+=ans//item

    print(result%(10**9+7))

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from fractions import gcd
    import sys
    n=int(input())
    a = tuple(map(int, input().split()))
    ans = 1

    mmm=10**9+7
    for i in a:
        ans = ans *i // gcd(ans, i)

    result=0
    for item in a:
      result+=ans//item

    print(result%mmm)

if __name__ == '__main__':
    main()
# C - Multiple Clocks
import math
N = int(input())
T = [int(input()) for i in range(N)]
# 最小公倍数を求める
DP = [0]*(N-1)
DP[0] = (T[0]*T[1])//math.gcd(T[0],T[1])
for i in range(1,N-1):
    DP[i] = (DP[i-1]*T[i+1]) // math.gcd(DP[i-1],T[i+1])

print(DP[-1])

### FIXED CODE ###

# C - Multiple Clocks
# import math mathはatcoderでは使えない
from fractions import gcd
N = int(input())
T = [int(input()) for i in range(N)]
# 最小公倍数を求める
if N == 1:
    print(T[0])
else:
    DP = [0]*(N-1)
    DP[0] = (T[0]*T[1])//gcd(T[0],T[1])
    for i in range(1,N-1):
        DP[i] = (DP[i-1]*T[i+1]) // gcd(DP[i-1],T[i+1])
    print(DP[-1])
import math
A,B,C,D = map(int,input().split())
lcm = int( C*D / ( math.gcd(C,D) )  )

first_c = int( ( A - 1) / C)
first_d = int( ( A - 1) / D)
first_cd = int( ( A - 1) / lcm )
first = ( A - 1 ) - ( first_c + first_d - first_cd )

end_c = int( B / C)
end_d = int( B / D)
end_cd = int( B / lcm )
end_ = B - ( end_c + end_d - end_cd )

print(end_ - first)


### FIXED CODE ###

A,B,C,D = map(int,input().split())
import fractions
lcm = int( C*D / ( fractions.gcd(C,D) ) )

first_c = ( A - 1) // C
first_d = ( A - 1) // D
first_cd = ( A - 1) // lcm 
first = ( A - 1 ) - ( first_c + first_d - first_cd )

end_c = B // C
end_d = B // D
end_cd = B // lcm 
end_ = B - ( end_c + end_d - end_cd )

print(end_ - first)
n = int(input())
a = list(map(int, input().split()))
a.sort()
result = 1
for i in range(len(a)):
  result = result*a[i]
  if result == 0:
    break
  elif result > 1000000000000000000
    break

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
result = 1
for i in range(len(a)):
  result = result*a[i]
  if result == 0:
    break
  elif result > 1000000000000000000:
    break

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
if n == 1:
    print(0)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors
m = make_divisors(n)
res = m[:len(m)//2]
if n //(res[-1]-1) != n % (res[-1]-1):
    res[-1] = 1
print(sum(res) - len(res))

### FIXED CODE ###

from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
if n == 1:
    print(0)
    quit()
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors
m = make_divisors(n)
res = m[:len(m)//2]
if n //(res[-1]-1) != n % (res[-1]-1):
    res[-1] = 1
print(sum(res) - len(res))
N = int(input())
A = list(map(int, input().split()))
A_ = [a-i-1 for i,a in enumerate(A)]
print (A_)
A_.sort()
print (A_)
b = A_[N//2]
print (b)
print(sum([abs(ai-b) for ai in A_]))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A_ = [a-i-1 for i,a in enumerate(A)]

A_.sort()

b = A_[N//2]

print(sum([abs(ai-b) for ai in A_]))
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

import math
p = [a, b, c, d, e]
pa = [a%10, b%10, c%10, d%10, e%10]
ans = math.ceil(a/10)*10 + math.ceil(b/10)*10 + math.ceil(c/10)*10 + math.ceil(d/10)*10 + math.ceil(e/10)*10 - (10 - pa[pa.index(min([i for i in pa if i != 0]))])
print(ans)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

import math
p = [a, b, c, d, e]
pa = []
for i in range(len(p)):
    if p[i]%10 == 0:
        pa.append(0)
    else:
        pa.append(10 - p[i]%10)

ans = math.ceil(a/10)*10 + math.ceil(b/10)*10 + math.ceil(c/10)*10 + math.ceil(d/10)*10 + math.ceil(e/10)*10 - max(pa)
print(ans)
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

if X * H == W * Y:
    multi = 1

S = max(X * H, W * Y)

print(S, multi)


### FIXED CODE ###

W, H, x, y = map(int, input().split())

S = W * H / 2
multi = 2 * x == W and 2 * y == H

print(S, int(multi))
N=int(input())
s=0
S=str(N):
for i in S:
    s+=i
if N%s==0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N=int(input())
s=0
S=str(N)
for i in S:
    s+=int(i)
if N%s==0:
    print("Yes")
else:
    print("No")
from fractions import gcd
#from math import gcd
import numpy as np

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

lcms=[A[0]]
[lcms.append(s*lcms[-1]//gcd(lcms[-1], s)) for s in A]
ans=np.sum(([lcms[-1]//s for s in A]))%(1e9+7)

print(int(ans))

### FIXED CODE ###

from fractions import gcd
#from math import gcd
import numpy as np
import sys
input = sys.stdin.readline
mod = 10**9+7

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

lcm = 1
for s in A:
    lcm = s*lcm//gcd(lcm, s)

ans = lcm*sum([pow(s, mod-2, mod) for s in A]) % mod
#ans = sum([lcm//s % mod for s in A]) % mod

print(int(ans%mod))
n = int(input())
red_point_list = [[int(j) for j in input().split()] for i in range(n)]
blue_point_list = [[int(j) for j in input().split()] for i in range(n)]

count = 0
memo = []

def func(red_points, blue_points, count):
    
    if len(red_points) == 0:
        memo.append(count)
    else:
        a = red_points[0][0]
        b = red_points[0][1]
        x = 0
        for i, p in enumerate(blue_points):
            if a < p[0] and b < p[1]:
                new_red_points = red_points[1:]
                new_blue_points = blue_points.copy()
                new_blue_points.pop(i)
                new_count = count + 1
                x += 1
                func(new_red_points, new_blue_points, new_count)
        if x == 0:
            new_red_points = red_points[1:]
            new_blue_points = blue_points.copy()
            func(new_red_points, new_blue_points, count)


func(red_point_list, blue_point_list, count)
print(max(memo))


### FIXED CODE ###

n = int(input())
red_point_list = [[int(j) for j in input().split()] for i in range(n)]
blue_point_list = [[int(j) for j in input().split()] for i in range(n)]

count = 0
for c, d in sorted(blue_point_list, key=lambda x: x[0]):
    tmp_index = 0
    tmp_y = -1
    for i, p in enumerate(red_point_list):
        if c > p[0] and d > p[1]:
            if p[1] >= tmp_y:
                tmp_index = i
                tmp_y = p[1]

    if tmp_y > -1:
        count += 1
        red_point_list.pop(tmp_index)

print(count)
D, G = map(int, input().split())

P = []
C = []
C2 = []
for i in range(D):
    p, c = map(int, input().split())
    P.append(p)
    c += p * (i+1) * 100
    C.append(c)
    C2.append(c/(p+1))

sort_C2 = sorted(C2, reverse=1)

num = 0
point = 0
question = [i for i in range(D-1, -1, -1)]


for i in range(D):
    x = C2.index(sort_C2[i])
    if C[x] <= G - point:
        num += P[x]
        point += C[x]
        question.remove(x)
    else:
        y = question[0]

        if C[x] < (y+1) * 100:
            continue

        n = -(-(G - point)) // ((y+1) * 100)
        if P[y] < n:
            num += P[y]
        else:
            num += n
        break

print(num)



### FIXED CODE ###

import math
D, G = map(int, input().split())

P = []
C = []
for i in range(D):
    p, c = map(int, input().split())
    P.append(p)
    C.append(c)

answer = sum(P)
for i in range(2**D):
    point = 0
    x = -1
    now_answer = 0
    for j in range(D):
        if i >> j & 1:
            point += P[j] * (j+1) * 100 + C[j]
            now_answer += P[j]
        else:
            x = j

    if G <= point:
        answer = min(now_answer, answer)
    else:
        n = math.ceil((G - point) / ((x+1) * 100))
        if n < P[x]:
            now_answer += n
            answer = min(now_answer, answer)

print(answer)
N = int(input())
P = [float(i) for i in input().split()]

dp = [0, 1, 0, 0, 0, 0]
for i, p in enumerate(P):
    print(dp)
    dp = [p * dp[j - 1] + (1 - p) * dp[j] for j in range(1, N + 2)]

print(sum(dp[-(-N // 2):]))

### FIXED CODE ###

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

dp = [[0.0] * (N + 1) for _ in range(N + 1)]
dp[0][0] = 1.0

for i, p in enumerate(P, 1):
    for j in range(N + 1):
        dp[i][j] = p * dp[i - 1][j - 1] + (1 - p) * dp[i - 1][j]

print(sum(dp[N][-(-N // 2):]))
import math 

N=int(input())
l=10**9+7
nums=list(map(int,input().split()))
k=int(math.log2(max(nums)))+1
mat=[0]*k
for each in nums:
    num=(str(bin(each))[2:])[::-1]
    kk=len(num)
    for i in range(kk):
        if num[i]=="1":
            mat[i]+=1

ans=sum([ (N-mat[i])*mat[i]*pow(2,i,l) for i in range(k)])
print(ans%l)

### FIXED CODE ###

mod=10**9+7
N=int(input())
str_a = ''.join(['{:060b}'.format(a) for a in map(int, input().split())])

ans=0
for i in range(60):
    ones=str_a[59-i::60].count("1")
    ans+= pow( 2, i ,mod)* ones *(N-ones)
print(ans%mod)
import math
n, x = map(int, input().split())
cities = list(map(int, input().split()))
cities.append(x)
cities.sort()
 
def get_res(cities):
    if len(cities) == 2:
        return cities[1] - cities[0]
    else:
        gcds = []
        for i in range(len(cities) - 2):
            c1 = cities[i]
            c2 = cities[i + 1]
            c3 = cities[i + 2]
            gcds.append(math.gcd(c2 - c1, c3 - c2))

        return min(gcds)
 
print(get_res(cities))

### FIXED CODE ###

n, x = map(int, input().split())
cities = list(map(int, input().split()))
cities.append(x)
cities.sort()

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def get_res(cities):
    if len(cities) == 2:
        return cities[1] - cities[0]
    else:
        gcds = []
        for i in range(len(cities) - 2):
            c1 = cities[i]
            c2 = cities[i + 1]
            c3 = cities[i + 2]
            gcds.append(gcd(c2 - c1, c3 - c2))
        return min(gcds)

print(get_res(cities))
n = int(input())
S = ['S']
H = ['H']
C = ['C']
D = ['D']
for i in range(0, n):
 x = input().split()
 if x[0] == 'S':
  S.append(int(x[1])
 elif x[0] == 'H':
  H.append(int(x[1])
 elif x[0] == 'C':
  C.append(int(x[1])
 else:
  D.append(int(x[1])
def print(list):
 list.sort()
 for i in range(1, 14):
  if i not in list:
   print("{0} {1}".format(list[0], i, end = "\n")
print(S)
print(H)
print(C)
print(D)
 

### FIXED CODE ###

n = int(input())
S = []
H = []
C = []
D = []
for i in range(0, n):
 x = list(input().split())
 if x[0] == 'S':
  S.append(int(x[1]))
 elif x[0] == 'H':
  H.append(int(x[1]))
 elif x[0] == 'C':
  C.append(int(x[1]))
 else:
  D.append(int(x[1]))
def pr(list, type):
 list.sort()
 for i in range(1, 14):
  if i not in list:
   print("{0} {1}".format(type, i))
pr(S, 'S')
pr(H, 'H')
pr(C, 'C')
pr(D, 'D')