Harryxun/stf_run huggingface dataset:
import numpy as np
L, R = map(int, input().split(" "))
arr = np.array(np.arange(L, R+1))
mod_list = []
min_mod_list = []
if (0 in (arr % 2019)) or (0 in arr):
  print(0)
else:
  for i in arr:
    
    for j in arr[arr != i]:
      mod_list.append(((i * j) % 2019))
    
    min_mod_list.append(min(mod_list))
    del mod_list
    mod_list = []
  
  
  print(min(min_mod_list))

### FIXED CODE ###

import numpy as np

L, R = map(int, input().split(" "))
#L, R = 2020, 4000000000
if R - L > 2019:
    print(0)
else:
    arr = np.array(np.arange(L, R+1))
    mod_list = []
    min_mod_list = []
    
    if (0 in (arr % 2019)) or (0 in arr):
        print(0)
    else:
    
        for i in arr:
            mod_list = []
            index_ = np.where(arr==i)
            if i == arr[-1]:
                break
            
            for j in arr[int(index_[0])+1:]:
                mod_list.append((i * j) % 2019)
     
            min_mod_list.append(min(mod_list))
            if min(mod_list) == 0:
                break
    
    
        print(min(min_mod_list))
n = input()
a = []
for i in range(n):
  a.append(input())
a = a.sort()[:3]
b = []
for i in [0,1,2]:
  for j in [0,1,2]:
    if i != j:
      b.append(int(str(a[i] + a[j])))
b.sort()
print(b[2])


### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
a = a[:4]
b = []
for i in [0,1,2,3]:
  for j in [0,1,2,3]:
    if i != j:
      b.append(int(str(a[i]) + str(a[j])))
b.sort()
print(b[2])
from collections import deque
import sys
sys.setrecursionlimit(100000)


def copyDeque(d):
    x = deque()
    for i in d:
        x.append(i)
    return x

def cndP(w):
    if len(w)>1:
        x = w.pop()
        cndP(copyDeque(w))
        w.append(x)
        s = 0
        while(len(w)>0):
            s += w.pop()
            st.add(s)
    else:
        st.add(w[0])
        
def pIsAccptbl(w,k,p):
    tr = 0
    c = 0
    d = copyDeque(w)
    while(d):
        tmp = d.popleft()
        if(tmp > p):
            return False
        
        if( tr + tmp > p):
            tr = tmp
            c += 1
        else:
            tr += tmp
        if c+1>k:
            return False
    return True

n,k = [int(x) for x in input().split()]
for i in range(n):
    w.append(int(input()))
    
st = set()
cndP(copyDeque(w))

sorted_st = sorted(st)
for i in sorted_st:
    if pIsAccptbl(w,k,i):
        print(i)
        break

### FIXED CODE ###

from collections import deque

def isPa(w,k,p):
    tr = 0
    c = 0
    d = deque(w)
    while(d):
        tmp = d.popleft()
        if(tmp > p):
            return False
        
        if( tr + tmp > p):
            tr = tmp
            c += 1
        else:
            tr += tmp
        if c+1>k:
            return False
    return True

def MaxInP(w,k,p):
    maxinp = 0
    tmp = 0
    d = deque(w)
    while(d):
        tmp += d.popleft();
        if(tmp > p):
            if(tmp > maxinp):
                maxinp = tmp
            tmp = 0
    return maxinp

n,k = [int(x) for x in input().split()]
w = deque()
for i in range(n):
    w.append(int(input()))
    
mean = int(sum(w)/k)
maxinp = MaxInP(w,k,mean)

if k == 1:
    print(mean)
else:
    minP = mean
    maxP = maxinp
    while(True):
        m = int ((minP + maxP)/2)
        if ( isPa(w,k,m) ):
            maxP = m
        else:
            minP = m
        if (minP+1 == maxP or minP == maxP):
            print(maxP)
            break
given = int(input())
ans = 0
for i in range(given):
  current = str(i + 1)
  if len(current) & 1:
    ans += 1
  
print(ans)

### FIXED CODE ###

a, b, c = [int(x) for x in input().split()]
print(c - min(c, a - b))
class Dice:
    def __init__(self, data):
        self.data = data

    def judge(self, dice):
        if self.data[0] != dice[0]:
            for i in range(4):
                if self.data[0] == dice[0]:
                    break
                self.move('E')
            for i in range(4):
                if self.data[0] == dice[0]:
                    break
                self.move('N')
        if self.data[1] != dice[1]:
            for i in range(3):
                self.move('R')
                if self.data[1] == dice[1]:
                    break
        if self.data[2] == dice[2]:
            return 'Yes'
        else:
            return 'No'


dice = Dice(input().split())
hoge = [i for i in input().split()]

print(dice.judge(hoge))

### FIXED CODE ###

class Dice:
    def __init__(self, data):
        self.data = data

    def __eq__(self, value):
            
        for i in range(4):
            if self.data[0] == value.data[0]:
                for j in range(4):
                    if self.data == value.data:
                        return True
                    self.move('R')
            self.move('E')

        for i in range(4):
            if self.data[0] == value.data[0]:
                for j in range(4):
                    if self.data == value.data:
                        return True
                    self.move('R')
            self.move('N')
        return False

    def move(self, direction):
        if direction == 'E':
            self.data[0],self.data[3], self.data[5], self.data[2] = \
                self.data[3],self.data[5], self.data[2], self.data[0] 
        elif direction == 'N':
            self.data[0],self.data[1], self.data[5], self.data[4] = \
                self.data[1],self.data[5], self.data[4], self.data[0]
        elif direction == 'S':
            self.data[0],self.data[1], self.data[5], self.data[4] = \
                self.data[4],self.data[0], self.data[1], self.data[5]
        elif direction == 'W':
            self.data[0],self.data[2], self.data[5], self.data[3] = \
                self.data[2],self.data[5], self.data[3], self.data[0]
        elif direction == 'R':
            self.data[1],self.data[2], self.data[4], self.data[3] = \
                self.data[2],self.data[4], self.data[3], self.data[1]

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

if a == b:
    print('Yes')
else:
    print('No')
# -*- coding: utf-8 -*-
import math
import sys
import bisect

## input
a,b,q = map(int, sys.stdin.readline().rstrip().split())
s_s, t_s, x_s = [[], [], []]
for _ in range(a):
  s_s.append(int(sys.stdin.readline().rstrip()))
for _ in range(b):
  t_s.append(int(sys.stdin.readline().rstrip()))
for _ in range(q):
  x_s.append(int(sys.stdin.readline().rstrip()))


## solve
def get_otherlen(st_type, k):
  if st_type == 's':
    st_s = s_s
  else:
    st_s = t_s

  idx = bisect.bisect_left(st_s, k)
  if idx == 0:
    mn = abs(st_s[0]-k)
  elif idx == len(s_s):
    mn = abs(st_s[-1]-k)
  else:
    mn = min(abs(st_s[idx]-k), abs(st_s[idx-1]-k))
  return(mn)


def get_len(k):
  # s -> t
  idx = bisect.bisect_left(s_s, k)
  if idx == 0:
    mn = abs(s_s[0]-k) + get_otherlen('t', s_s[0])
  elif idx == len(s_s):
    mn = abs(s_s[-1]-k) + get_otherlen('t', s_s[-1])
  else:
    mn1 = abs(s_s[idx]-k) + get_otherlen('t', s_s[idx])
    mn2 = abs(s_s[idx-1]-k) + get_otherlen('t', s_s[idx-1])
    mn = min(mn1, mn2)

  # t -> s
  idx = bisect.bisect_left(t_s, k)
  if idx == 0:
    mn = min(mn, abs(t_s[0]-k) + get_otherlen('s', t_s[0]))
  elif idx == len(t_s):
    mn = min(mn, abs(t_s[-1]-k) + get_otherlen('s', t_s[-1]))
  else:
    mn1 = abs(t_s[idx]-k) + get_otherlen('s', t_s[idx])
    mn2 = abs(t_s[idx-1]-k) + get_otherlen('s', t_s[idx-1])
    mn = min(mn, mn1, mn2)
  return(mn)


if __name__ == "__main__":
  for x in x_s:
    print(get_len(x))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
import sys
import bisect

## input
a,b,q = map(int, sys.stdin.readline().rstrip().split())
s_s, t_s, x_s = [[-10**11], [-10**11], []]
for _ in range(a):
  s_s.append(int(sys.stdin.readline().rstrip()))
for _ in range(b):
  t_s.append(int(sys.stdin.readline().rstrip()))
for _ in range(q):
  x_s.append(int(sys.stdin.readline().rstrip()))
s_s.append(10**11)
t_s.append(10**11)


def solve(k):
  s_pos = bisect.bisect_left(s_s, k)
  t_pos = bisect.bisect_left(t_s, k)
  mn = 10**11
  for i in [s_s[s_pos-1], s_s[s_pos]]:
    for j in [t_s[t_pos-1], t_s[t_pos]]:
      mn = min(mn,abs(i-k)+abs(i-j), abs(j-k)+abs(i-j))
  return(mn)

if __name__ == "__main__":
  for x in x_s:
    print(solve(x))
a, b = input(int())
c = a*b
if c % 2 == 0:
  print("Even")
else:
  print("Odd)


### FIXED CODE ###

a,b = input().split()
result = int(a) * int(b)
     
if result % 2 == 0:
	print("Even")
else :
	print("Odd")
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
n=0
for j in range(N):
 k=V[j]-C[j]
 if k>0:
   n+=k
print(n)

### FIXED CODE ###

A,B,T=map(int,input().split(" "))
ans=T//A*B
print(ans)
n = int(raw_input())
for i in range(n):
    x0, y0, x1, y1, x2, y2, x3, y3 = map(float, raw_input().split(' '))
    if float(y1-y0)/(x1-x0) == float(y3-y2)/(x3-x2):
        print 'YES'
    else:
        print 'NO'    

### FIXED CODE ###

n = int(raw_input())
for i in range(n):
    x0, y0, x1, y1, x2, y2, x3, y3 = map(float, raw_input().split(' '))
    if x0==x1 or x2==x3:
        if x0==x1 and x2==x3:
            print 'YES'
        else:
            print 'NO'
    elif abs(float(y1-y0)/(x1-x0) - float(y3-y2)/(x3-x2)) < 1e-10:
        print 'YES'
    else:
        print 'NO'
n=int(input())
l=list(map(int,input().split()))
print('%d %d %d'%(min(l), max(l), sum(l))

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
print('%d %d %d'%(min(l), max(l), sum(l)))
m = 1e13
NIL = -1

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")



### FIXED CODE ###

n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")
import math

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

m = int(math.log2(max(a))) + 1

total = 0
num = 1
while True:
    if num == n:
        break
    p, q = 0, 0
    for i in range(0, n - num):
        p += a[i] << m * (n-num-i-1)
        q += a[num + i] << m * (n-num-i-1)
    r = p ^ q
    for i in range(0, n - num):
        total += (r % (2 ** m)) % 1000000007
        r = r >> m
    num += 1

print(total % 1000000007)

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
bits = [0] * 60
MOD = 10**9 + 7

for a in A:
    div = a
    i = 0
    while True:
        div, mod = div // 2, div % 2
        bits[i] += mod
        i += 1
        if div == 0:
            break

ans = 0
for i in range(60):
    ans += bits[i] * (n-bits[i]) * 2 ** i % MOD
print(ans % MOD)
def SumOfProduct(n, arrayA):
  ans = 0

  for i in range(0, len(arrayA)):
    for j in range(i + 1, len(arrayA)):
      ans += arrayA[i] * arrayA[j]

  print(ans)

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

SumOfProduct(n, arrayA)


### FIXED CODE ###

requestMap = list(map(float, input().split()))

D = requestMap[0]
T = requestMap[1]
S = requestMap[2]

dist = S * T

if dist >= D:
  print("Yes")
else:
  print("No")
a,b = map(int,raw_input.split())
print a * b  (a + b) * 2

### FIXED CODE ###

a, b = map(int,raw_input().split())
print a * b, (a + b) * 2
String=input()
String=list(String)
String=[(String[i:i+2]) for i in range(0, len(String),2)]
String[0]="".join(String[0])
String[1]="".join(String[1])
String[0]=int(String[0])
String[1]=int(String[1])
if(String[0]>=0 and String[0]<=12and String[1]>0 and String[1]<=12):
    print("AMBIGUOUS")
elif(String[0]==String[1]==0 or String[0]>12 and String[0]!=0 and String[1]>12 and String[1]!=0):
    print("NA")
elif(String[1]>0 and String[1]<13):
    print("YYMM")
elif(String[0]>0 and String[0]<13):
    print("MMYY")
elif(String[0]==0 and String[1]>12):
    print("NA")
else:
    print("NA")

### FIXED CODE ###

String=input()
String=list(String)
String=[(String[i:i+2]) for i in range(0, len(String),2)]
String[0]="".join(String[0])
String[1]="".join(String[1])
String[0]=int(String[0])
String[1]=int(String[1])
if(String[0]>0 and String[0]<=12and String[1]>0 and String[1]<=12):
    print("AMBIGUOUS")
elif(String[0]==String[1]==0 or String[0]>12 and String[0]!=0 and String[1]>12 and String[1]!=0):
    print("NA")
elif(String[1]>0 and String[1]<13):
    print("YYMM")
elif(String[0]>0 and String[0]<13):
    print("MMYY")
elif(String[0]==0 and String[1]>12):
    print("NA")
else:
    print("NA")
import itertools
from math import factorial
from scipy.special import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

### FIXED CODE ###

import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))
import bisect

N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()
ans=0
i=0

if T[0]+K>=T[-1]:
  print(1)
else:
  while True:
    if i==N-1:
      ans+=1
      break
    i=bisect.bisect_left(T,T[i]+K)
    ans+=1
  print(ans)

### FIXED CODE ###

import bisect
import sys

N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()
ans=0
i=0

if T[0]+K>=T[-1]:
  if N%C==0:
    print(N//C)
  else:
    print(N//C+1)
  sys.exit()
else:
  while True:
    t=bisect.bisect_right(T,T[i]+K)
    if t-i>C:
      i+=C
    else:
      i=t
    ans+=1
    if i==N-1:
      ans+=1
      break
    if i>N-1:
      i=N-1
      break
print(ans)
N = map(int, input().split())
count = 0

while N % 2 == 0:
  N / 2
  count += 1
print(count)

### FIXED CODE ###

N = int(input())
k = 0
while 1:
  if 2**k > N:
    break
  ans = 2**k
  k += 1
print(ans)
# D
# Multiple of 2019

s = input()

d = len(s)

ans = 0

if d < 5:
    if int(s)%2019 == 0:
        print("1")
    else:
        print("0")
else:
    for j in range(4,d,1):
        for i in range(j-3):
            _tmp = int(s[i:j+1])
            if _tmp % 2019 == 0:
                ans +=1

    print(ans)

### FIXED CODE ###

# A
# Sheep and Wolves

s, w = map(int, input().split())

if s <= w:
    print("unsafe")
else:
    print("safe")
pi = 3.14159265
r = int(input())

area = r * r * pi
length = r * 2 * pi

print("{0:.6f}".format(area),end=' ')
print("{0:.6f}".format(length))

### FIXED CODE ###

import math
r = float(input())

area = r * r * math.pi
length = r * 2 * math.pi

print("{0:.6f}".format(area),end=' ')
print("{0:.6f}".format(length))
a,b = input().split()

if a == "H":
    print(b)
else if b == "H":
    print(a)
else:
    print("H")

### FIXED CODE ###

a,b = input().split(' ')
 
if a == "H":
    print(b)
elif b == "H":
    print(a)
else:
    print("H")
from math import gcd
N = int(input())
sum = 0
for i in range(1, N+1):
    for j in range(1, N+1):
		tmp=gcd(j,k)
        for k in range(1, N+1):
            sum += gcd(i, tmp)
print(sum)


### FIXED CODE ###

from math import gcd
N = int(input())
sum = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        tmp=gcd(i,j)
        for k in range(1, N+1):
            sum += gcd(tmp,k)
print(sum)
l,r = map(int,(input().split()))
if r-l>=2018:
    print('0')
    sys.exit()

else:
    if l%2019>r%2019:
        l=l%2019
        r=r%2019+2019
    else:
        l=l%2019
        r=r%2019

        m=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            a =i*j%2019
            m =min(m,a)

    print(m)


### FIXED CODE ###

import sys
l,r = map(int,(input().split()))
if r-l>=2018:
    print(0)
    sys.exit()

else:
    if l%2019>r%2019:
        l=l%2019
        r=r%2019+2019
    else:
        l=l%2019
        r=r%2019

    m=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            a =i*j%2019
            m =min(m,a)

    print(m)
# -*- coding: utf-8 -*-
"""
Contents   : AtCoder Grand Contest 024 B問題 WA
Author     : Kitaura Hiromi
LastUpdate : 20180520
Since      : 20180520
"""
N = int(input())
p = []
q = [0] * N
for i in range(N):
    p.append(int(input()))
    q[p[i]-1] = i

cnt = 1
seq = []
for i in range(N-1):
    if q[i+1] - q[i] > 0:
        cnt += 1
    else:
        seq.append(cnt)
        cnt = 1
max_cnt = max(seq)
print(N - max_cnt)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Contents   : AtCoder Grand Contest 024 B問題 WA
Author     : Kitaura Hiromi
LastUpdate : 20180520
Since      : 20180520
"""
N = int(input())
p = [int(input()) for i in range(N)]
q = [0 for i in range(N)]
for i in range(N):
    q[p[i]-1] = i

cnt = 1
max_cnt = 1
for i in range(N-1):
    if q[i+1] > q[i]:
        cnt += 1
    else:
        max_cnt = max(max_cnt, cnt)
        cnt = 1
max_cnt = max(max_cnt, cnt)
print(N - max_cnt)
su=0
for i in range(3):
  l=list(map(int,input().split()))
  s=sum(l)
  su+=s
if su%3!=0:
  print('No')
  exit()
ll=[list(map(int,input().split())) for i in range(3)]
for i in range(2):
  for j in range(i+1,3):
    for k in range(3):
       if ll[k][i]==ll[k][j]:
          if not all(ll[t][i]==ll[t][j] for t in range(3)):
            print('No')
            exit()
        if ll[i][k]==ll[j][i]:
          if not all(ll[i][t]==ll[j][t] for t in range(3)):
            print('No')
            exit()
       
print('Yes')

### FIXED CODE ###

l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0]
y=l[0][1]
z=l[0][2]
a=0
b=l[1][0]-x
c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')
import sys
sys.setrecursionlimit(10**6)

n = int(input())
x = input()
xi = int('0b' + x, 2)
xc = x.count("1")

if xc == 0:
  for _ in range(n):
    print(1)
  exit()

xip = xi % (xc+1)
xim = xi % (xc-1)

def f(u):
  if u==0: return 0
  m = u % bin(u).count("1")
  return 1 + f(m)

for i in range(n):
  if x[i] == "0":
    # y = xip + (pow(2, n-i-1, )%(xc+1))
    y = xip + pow(2, n-i-1, xc+1)
    y = y % (xc+1)
  elif xc == 1:
    print(0)
    continue
  else:
    # y = xim - (pow(2, n-i-1)%(xc-1))
    y = xim - pow(2, n-i-1, xc-1)
    y = y % (xc-1)

  print(f(y)+1)


### FIXED CODE ###

N = int(input())
X = input()
val = int(X,2)
C = X.count("1")

if C==1:
  for i in range(N):
    if X[i]=='1':
      print(0)
    elif i==N-1:
      print(2)
    else:
      print(1)
  exit()

# xをpopcountで割ったあまりに置き換える
def f(x):
  if x==0: return 0
  return 1 + f(x % bin(x).count("1"))

# 初回のpopcountでの割り方は、(C+1) or (C-1)
Y = val%(C+1)
if C-1 != 0:
  Z = val%(C-1)
else:
  Z = 0

for i in range(N):
  if X[i] == "1":
    if Z - 1 == 0:
      print(0)
      continue
    k = (Z - pow(2,N-i-1,C-1)) % (C-1)
  else:
    k = (Y + pow(2,N-i-1,C+1)) % (C+1)
  print(f(k)+1)
sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if color == 1 and ball > 1:
  print(0)
else:
	product = color


# for i in range(1, ball):
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices


### FIXED CODE ###

sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if ball > 1 and color == 1:
  print(0)
else:
  product = color
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices
N = int(input())
S = input()
print(S.count("ABC")


### FIXED CODE ###

N = int(input())
S = input()
print(S.count("ABC"))
a,b,n=map(int,input().split())
C = set(set([a:min(a+n,b)])|set([max(a,b-n):b]))
for i in list(C):
  print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())
if b-a+1>k*2:
  for i in range(a,a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)
else:
  for h in range(a,b+1):
    print(h)
N,M = map(int,input().split())
prices = list(map(int,input().split()))
prices.sort(reverse=True)
big = prices[:M]
small = prices[M:]

discounted = [int(big[0]/2)]
i = 1
if N > 1 and M > 1:
  temp = big[1]
  for m in range(1,M):
    for index in range(len(discounted)):
      if discounted[index]/2 > temp/2:
        discounted[index] = int(discounted[index]/2)
        break
    else:
      discounted.append(int(temp/2))
      i += 1
      temp = big[i]
else:
  for m in range(1,M):
    discounted[0] = int(discounted[0]/2)
  
result = sum(small) + sum(big[i:]) + sum(discounted)
print(result)

### FIXED CODE ###

import heapq
N,M = map(int,input().split())
prices = list(map(int,input().split()))
for i in range(len(prices)):
  prices[i] *= -1

heapq.heapify(prices)
for i in range(M):
  temp = heapq.heappop(prices)
  temp *= -1
  temp //= 2
  temp *= -1
  heapq.heappush(prices,temp)

print(sum(prices)*-1)
import numpy as np
X, Y, Z, K = [int(i) for i in input().split()]

A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)

Anum = 0
Bnum = 0
Cnum = 0

AB=np.zeros(X*Y)
for i in range(X):
    for j in range(Y):
        AB[Y*i+j] = A[i]+B[j]

AB = np.sort(AB)[::-1]
AB = AB[:min(X*Y,K)]

ABC=np.zeros(len(AB)*Z)
for i in range(len(AB)):
    for j in range(Z):
        ABC[Z*i+j]=AB[i]+C[j]

ABC = np.sort(ABC)[::-1]

for i in range(K):
    print(int(ABC[i]))


### FIXED CODE ###

X, Y, Z, K = [int(i) for i in input().split()]

A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)

Anum = 0
Bnum = 0
Cnum = 0

AB = []
for i in range(X):
    for j in range(Y):
        AB.append(A[i]+B[j])

AB = sorted(AB, reverse=True)
AB = AB[:min(X*Y,K)]

ABC = []
for i in range(len(AB)):
    for j in range(Z):
        ABC.append(AB[i]+C[j])

ABC = sorted(ABC, reverse=True) 

for i in range(K):
    print(int(ABC[i]))
K = input()
(A, B) = map(int, input().split())
buf = True
for i in range(A, B + 1):
  if(i % K == 0):
    print("OK")
	return 
print("NG")

### FIXED CODE ###

K = int(input())
(A, B) = map(int, input().split())
buf = True
for i in range(A, B + 1):
  if(i % K == 0):
    print("OK")
    buf = False
    break
if buf:
  print("NG")
n = int(input())
a = input().split(" ")

sum = 1
for i in a:
  sum = sum * int(i)

if sum > 1000000000000000000:
  print(-1)
else:
  print(sum)

### FIXED CODE ###

n = int(input())
a = input().split(" ")

sum = 1
for i in a:
  sum = sum * int(i)
  if sum > 1000000000000000000:
    break

if "0" in a:
  print(0)
elif sum > 1000000000000000000:
  print(-1)
else:
  print(sum)
N = int(input())
N_list = list(N)
if N_list[0] = 2 or N_list[0] = 4 or N_list[0] = 5 or N_list[0] = 7 or N_list[0] = 9:
    print(hon)
elif N_list[0] = 0 or N_list[0] = 1 or N_list[0] = 6 or N_list[0] = 8:
    print(pon)
else:
    print(bon)
    

### FIXED CODE ###

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