qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
p = [int(input()) for _ in range(N)]
p = sorted(p)
print(sum(p[:]) + p[-1]//2)

Fixed code:
N = int(input())
p = [int(input()) for _ in range(N)]
p = sorted(p)
print(sum(p[:]) - p[-1]//2)
Buggy code:
n = int(input())
max = 0
sum = 0

#print ("START")
for i in range(n):
	data = (input()
#	print("aaa")
	data = int(data)
#	print(data)
	if max < data:
		max = data
	sum = sum + data
print(sum - max//2)

Fixed code:
n = int(input())
max = 0
sum = 0

#print ("START")
for i in range(n):
	data = input()
#	print("aaa")
	data = int(data)
#	print(data)
	if max < data:
		max = data
	sum = sum + data
print(sum - max//2)
Buggy code:
n=int(input())
p=[int(input()) for i in range(n)]
f=max(p)
ans=sum(p)-f+(f//2)

Fixed code:
n=int(input())
p=[int(input()) for i in range(n)]
f=max(p)
ans=sum(p)-f+(f//2)
print(ans)
Buggy code:
n = int(input())
p = [int(input()) for _ in range(n)]
print(p.sum() - p.max()//2)

Fixed code:
n = int(input())
p = [int(input()) for _ in range(n)]
print(int(sum(p)-max(p)//2))
Buggy code:
import numpy as np

N = int(input())
price = []

for i in range(N):
    price.append(int(input()))

price = np.array(price)
max_index = np.argmax(price)

print(int(np.sum(price) - price[max_index] / 2

Fixed code:
import numpy as np

N = int(input())
price = []

for i in range(N):
    price.append(int(input()))

price = np.array(price)
max_index = np.argmax(price)

print(int(np.sum(price) - price[max_index] / 2))
Buggy code:
N=int(input())
p=sorted([int(input()) for i in range(N)])[::-1]

Sum=p[0]/2

for i in range(1,N):
  Sum=Sum+p[i]

print(Sum)

Fixed code:
N=int(input())
p=sorted([int(input()) for i in range(N)])[::-1]

Sum=p[0]/2

for i in range(1,N):
  Sum=Sum+p[i]

print(int(Sum))
Buggy code:
N = int(input())
price_list = []
append = pricelist.append
for i in range(N):
	p = int(input)
    append(p)
pricelist.sort(reverse=True)
pricelist[0] = pricelist[0] / 2
print(sum(pricelist))

Fixed code:
N = int(input())
price_list = []
append = price_list.append
for i in range(N):
    p = int(input())
    append(p)
price_list.sort(reverse=True)
price_list[0] = price_list[0] // 2
print(sum(price_list))
Buggy code:
N = int(input())
price_list = []
append = price_list.append
for i in range(N):
    p = int(input())
    append(p)
price_list.sort(reverse=True)
price_list[0] = price_list[0] / 2
print(sum(price_list))

Fixed code:
N = int(input())
present = []

for i in range(N):
    p = int(input())
    present.append(p)

present.sort(reverse=True)
present[0] //= 2

print(sum(present))
Buggy code:
N, *d = map(int, open(0).read().split())
print(sum(d)-max(s)/2)

Fixed code:
N, *d = map(int, open(0).read().split())
print(int(sum(d)-max(d)/2))
Buggy code:
N = int(input())

p = []
for n in range(N):
    p.append(n)

p_max = max(p)
p_sum = sum(p) - p_max
p_max *= 0.5

print(p_sum + p_max)

Fixed code:
N = int(input())

p = []
for n in range(N):
    p.append(int(input()))

p_max = max(p)
p_sum = sum(p) - p_max
p_max *= 0.5

print(int(p_sum + p_max))
Buggy code:
N, *d = map(int, open(0).read().split())
print(sum(d)-max(d)/2)

Fixed code:
N, *P = map(int, open(0).read().split())
print(sum(P) - max(P) // 2)
Buggy code:
nN = int(input())
nP = [ 0 for i in range(nN)]
 
for i in range(nN):
  nP[i] = int(input())
 
nP.sort(reverse=True)
 
nAns = 0
for i in range(nN):
  if i == 0:
    nAns += (nP[i]//2)
  else:
    nAns += nP[i]
 
print((%d) %(nAns))


Fixed code:
nN = int(input())
nP = [ 0 for i in range(nN)]
 
for i in range(nN):
  nP[i] = int(input())

nP.sort(reverse=True)
 
nAns = 0
for i in range(nN):
  if i == 0:
    nAns += (nP[i]//2)
  else:
    nAns += nP[i]

print('%d' %(nAns))
Buggy code:
N = int(input())
p = []
for i in range(N):
  p.append(int(input()))
  
print(int(sum(p)-max(p)/2)


Fixed code:
N=int(input())
P=[]
for i in range(N):
    p=int(input())
    P.append(p)
ans=sum(P)-max(P)//2
print(ans)
Buggy code:
N=int(input())
p = [int(input) for _ in range(len(N))]

print(sum(p) - int(max(p)/2))


Fixed code:
N=int(input())
p = [int(input()) for _ in range(N)]

print(sum(p) - int(max(p)/2))
Buggy code:
n = int(input())
p =[int(input())for i in range(n)]

m = max(p)/2
print(m+sum(p)-max(p))

Fixed code:
n = int(input())
p =[int(input())for i in range(n)]

m = max(p)//2
print(m+sum(p)-max(p))
Buggy code:
N=int(input())
price=[int(input()) for i in range(N)]
price.sort(reverse=True)
price[0]=price[0]//2
sum(price)

Fixed code:
N=int(input())
price=[int(input()) for i in range(N)]
price.sort(reverse=True)
price[0]=price[0]//2
a=sum(price)
print(a)
Buggy code:
N = int(input())
sm,mx = 0,0
for i in range(N):
  P = int(input())
  sm += P
  mx = max(mx, P)

print(sm - mx / 2)


Fixed code:
N = int(input())
sm,mx = 0,0
for i in range(N):
  P = int(input())
  sm += P
  mx = max(mx, P)

a = int(sm - mx / 2)
print(a)
Buggy code:
n=int(input())
a=[]
for i in range(n)
    p=int(input())
    a.append(p)
a.sort()
a[n-1]=int(a[n-1]/2)
print(sum(a))

Fixed code:
n=int(input())
a=[]
for i in range(n):
    p=int(input())
    a.append(p)
a.sort()
a[n-1]=int(a[n-1]/2)
print(sum(a))
Buggy code:
N = int(input())
p = [int(input()) for _ in N]
print(sum(p) - max(p) // 2)


Fixed code:
N = int(input())
p = [int(input()) for _ in range(N)]
print(sum(p)-max(p)//2)
Buggy code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = input()
p = []
for _ in range(N):
    p.append(int(input())

pmax = max(p)
ans = int(sum(p)-pmax/2)
print(ans)

Fixed code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
p = []
for _ in range(N):
    p.append(int(input()))

pmax = max(p)
ans = int(sum(p)-pmax/2)
print(ans)
Buggy code:
N = int(input())
P = [int(p) for p in input().split()]
P.sort(reverse=True)
print(int(sum(P)-(P[0]/2)))

Fixed code:
N = int(input())
P = [int(input()) for p in range(N)]
P.sort(reverse=True)
print(int(sum(P)-(P[0]/2)))
Buggy code:
n = int(input())
al = [int(input()) for _ in range(n)]
m = max(al)
s, f = 0, True
for i in range(n):
  if al[i] == m and flag:
    s += al[i] // 2
    f = False
  else:
    s += al[i]
print(s)


Fixed code:
n = int(input())
al = [int(input()) for _ in range(n)]
m = max(al)
s, f = 0, True
for i in range(n):
  if al[i] == m and f:
    s += al[i] // 2
    f = False
  else:
    s += al[i]
print(s)
Buggy code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())

p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)

Fixed code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
pay=0
p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)
Buggy code:
n = int(input())

max_index = 0
max_price = 0
price_list = []

for i in range(0, n + 1):
    p = int(input())
    price_list.append(p)
    if max_price < p:
        max_index = i

sum = 0
for i, p in enumerate(price_list):
    if i == max_index:
        sum += p / 2
    else:
        sum += p

print(sum)


Fixed code:
n = int(input())

max_index = 0
max_price = 0
price_list = []

for i in range(0, n):
    p = int(input())
    price_list.append(p)
    if max_price < p:
        max_price = p
        max_index = i

p_sum = 0
for i, p in enumerate(price_list):
    if i == max_index:
        p_sum += p / 2
    else:
        p_sum += p

print(int(p_sum))
Buggy code:
n=int(input())
p = [int(input()) for _ in range(n)]

print(sum(p)-max(p)/2)

Fixed code:
n=int(input())
p = [int(input()) for _ in range(n)]

print(int(sum(p)-max(p)/2))
Buggy code:
n = int(input())
a = sorted(list(map(int, [input() for i in range(n)])))
ans = sum(a) - a[n-1] / 2
print(ans)



Fixed code:
n = int(input())
a = sorted(list(map(int, [input() for i in range(n)])))
ans = sum(a) - (a[n-1] / 2)
print(int(ans))
Buggy code:
N = int(input())
p = []
for i in range(N):
  p_i = int(input())
  p.append(p_i)
  
p[p.index(max(p))] *= 1/2
print(sum(p))

Fixed code:
N = int(input())
p = []
for i in range(N):
    p_i = int(input())
    p.append(p_i)
  
p[p.index(max(p))] *= 1/2
print(int(sum(p)))
Buggy code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
p = [INT() for _ in range(N)]

print(sum(p)-1/2*max(p))

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 permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
p = [INT() for _ in range(N)]

print(int(sum(p)-1/2*max(p)))
Buggy code:
n=range(int(input()))
a=[int(input()) for i in n]
print(sum(a)-max(a)/2)

Fixed code:
a = [int(input()) for i in range(int(input()))]
print(int(sum(a)-max(a)/2))
Buggy code:
n=int(input())
price=[]
for i in range(n):
  price.append(int(input()))
  
price=sorted(price)

price[-1]=price[-1]/2

print(sum(price))
  

Fixed code:
n=int(input())
price=[]
for i in range(n):
  price.append(int(input()))
  
price=sorted(price)

price[-1]=price[-1]/2

print(int(sum(price)))
Buggy code:
n=int(input())
a=[int(input()) for i in n]
print(sum(a)-max(a)/2)

Fixed code:
n=range(int(input()))
a=[int(input()) for i in n]
print(sum(a)-max(a)//2)
Buggy code:
N = int(input)
p = sorted([int(input()) for _ in range(N)], reverse=True)
ans = p[0] // 2 + sum(p[1:])
print(ans)

Fixed code:
N = int(input())
p = sorted([int(input()) for _ in range(N)], reverse=True)
ans = p[0] // 2 + sum(p[1:])
print(ans)
Buggy code:
n = int(input())
p_list=[]
for i in range(n):
    p_list.append(int(i))
print(sum(p_list) - max(p_list)//2)

Fixed code:
n = int(input())
p=[]
for i in range(n):
    p.append(int(input()))
print(sum(p)-max(p)//2)
Buggy code:
N = int(input())


p = []
for i in range(N):
  p.append(int(input()))
  
p_max = p.index(max(p))


p[p_max] = p[p_max] / 2 

print(sum(p))

Fixed code:
N = int(input())


p = []
for i in range(N):
  p.append(int(input()))
  
p_max = p.index(max(p))


p[p_max] = p[p_max] / 2 

print(int(sum(p)))
Buggy code:
n = int(input(0))
p = [int(input()) for _ in range(n)]
print(sum(p) - max(p)//2)


Fixed code:
n = int(input())
p = [int(input()) for _ in range(n)]

ans = sum(p) - max(p)//2

print(ans)
Buggy code:
n = int(input())
list = []
for i in range(n):
  list.append(int(input()))

p_max = max(list)

ans = sum(list) - p_max/2

print(ans)

Fixed code:
n = int(input())
list = []
for i in range(n):
  list.append(int(input()))
p_max = max(list)
ans = sum(list) - p_max/2
print(int(ans))
Buggy code:
n, *a = map(int, open(0).read().split())
print(sum(a) - sorted(a)[-1])

Fixed code:
n, *a = map(int, open(0).read().split())
print(sum(a) - sorted(a)[-1] // 2)
Buggy code:
n = int(input())
p = []
for i in range(n):
  p.append(int(input()))
  
print(sum(p) - max(p)/2)

Fixed code:
n = int(input())
p = []
for i in range(n):
  p.append(int(input()))
  
print(sum(p) - max(p)//2)
Buggy code:
n = input()
l = [int(input()) for _ in range(n)]
print(sum(l)-max(l)/2)

Fixed code:
n = int(input())
l = [int(input()) for _ in range(n)]
print(sum(l)-int(max(l)/2))
Buggy code:
n = int(input())
p = [int(input()) for i in range(n)]
p_max = p[0]
for j in range(1, n):
    if p[j] >= p_max:
        p_max = p[j]
for k in range(n):
    if p[k] == p_max:
        p[k] = int(p[k] / 2)
print(sum(p))




Fixed code:
n = int(input())
p = [int(input()) for i in range(n)]
p_max = p[0]
for j in range(1, n):
    if p[j] >= p_max:
        p_max = p[j]
for k in range(n):
    if p[k] == p_max:
        p[k] = int(p[k] / 2)
        break
print(sum(p))
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Wed Jan  2 09:53:30 2019

@author: Yamazaki Kenichi
"""

N = int(input())
p = [int(input()) for i in range(N)]

max(p)
ans = sum(p) - max(p)/2
int(ans)

print(ans)


Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Wed Jan  2 09:53:30 2019

@author: Yamazaki Kenichi
"""

N = int(input())
p = [int(input()) for i in range(N)]

max(p)
ans = int(sum(p) - max(p)/2)

print(ans)
Buggy code:
#coding:utf-8

N = input()

p = []
max_val = -1
for i in range(N):
    p_i = input()
    p.append(p_i)
    max_val = max(max_val, p_i)

sum = 0
flag = 0
for p_i in p:
    if p_i == max_val and flag==0:
        sum += p_i * 0.5
        flag = 1
    else:
        sum += p_i
print(int(sum))
        


Fixed code:
#coding:utf-8

N = int(input())
p = []
max_val = -1
for i in range(N):
    p_i = int(input())
    p.append(p_i)
    max_val = max(max_val, p_i)

s = 0
flag = 0
for p_i in p:
    if p_i == max_val and flag==0:
        s += p_i * 0.5
        flag = 1
    else:
        s += p_i
print(int(s))
Buggy code:
N = int(intput())

sum = 0
max = 0
for _ in range(N):
  p = int(intput())
  if(p > max):
    max = p
  sum += p
val = sum - max/2
print(int(val))

Fixed code:
N = int(input())
 
sum = 0
max = 0
for _ in range(N):
  p = int(input())
  if(p > max):
    max = p
  sum += p
val = sum - max/2
print(int(val))
Buggy code:
print((lambda x:sum(x)-max(x)/2)([int(input()) for i in range(int(input()))]))

Fixed code:
print(int((lambda x:sum(x)-max(x)/2)([int(input()) for i in range(int(input()))])))
Buggy code:

N = int(input())

pl = []


for i in range(N):

    pl.append(int(input()))


max = 0

t = 0

for j in range(N):

    if max < pl[j]:
        max = pl[j]
        
    t = t + pl[j]

print(max)

t = t + (max / 2) -max

print(int(t))


Fixed code:

N = int(input())

pl = []


for i in range(N):

    pl.append(int(input()))


max = 0

t = 0

for j in range(N):

    if max < pl[j]:
        max = pl[j]
        
    t = t + pl[j]

#print(max)

t = t + (max / 2) - max

print(int(t))
Buggy code:
n=int(input())
P=[int(input()) for i in range(n)]
sumOfP=sum(P)-P/2
print(sumOfP)

Fixed code:
n=int(input())
P=[int(input()) for i in range(n)]
sumOfP=int(sum(P)-max(P)/2)
print(sumOfP)
Buggy code:
N = int(input())

answer = 0
big = 0

for i in range(N):
	a = int(input())
	answer += a
	if big < a:
		big = a

print(int(answer-(big/2))

Fixed code:
N = int(input())

answer = 0
big = 0

for i in range(N):
	a = int(input())
	answer += a
	if big < a:
		big = a

print(int(answer-(big/2)))
Buggy code:
N = int(input())
D = []
for i in range(1, N + 1):
    pi = int(input())
    D.append(pi)
a = max(D)
b = sum(D)
ans = a / 2 + b - a
print(ans)

Fixed code:
N = int(input())
D = []
for i in range(1, N + 1):
    pi = int(input())
    D.append(pi)
a = max(D)
b = sum(D)
ans = int(a / 2 + b - a)
print(ans)
Buggy code:
a=int(input())
b=[input().split() for i in range(a)]
b=int(b)
b.sort()
c=sum(b)
print(int(c-b[a]/2))

Fixed code:
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
print(int(c-b[a-1]/2))
Buggy code:
N = int(input())
p = []
max = 0
for i in range(N):
  p.append(int(input()))
p.sort()
sum = 0
for i in range(N-1):
  sum += p[i]
sum += p[N-1]/2
print(sum)


Fixed code:
N = int(input())
p = []
max = 0
for i in range(N):
  p.append(int(input()))
p.sort()
sum = 0
for i in range(N-1):
  sum += p[i]
sum += p[N-1]/2
print(int(sum))
Buggy code:
N=int(input())
p_list=[int(input()) for i in range(N)]
s=sorted(p_list)
print(sum(s[:N-1])+s[N-1])

Fixed code:
N=int(input())
p_list=[int(input()) for i in range(N)]
s=sorted(p_list)
print(sum(s[:N-1])+s[N-1]//2)
Buggy code:
p=[int(input()) for _ in range(int(input()))]
print(sum(p)-max(p)/2)

Fixed code:
n = int(input())
p = [int(input()) for _ in range(n)]
print(sum(p)-(max(p)//2))
Buggy code:
a=int(input())
b=[int(input()) for i in range(a)]
print(sum(b)-max(b)/2)
  

Fixed code:
a=int(input())
b=[int(input()) for i in range(a)]
print(int(sum(b)-max(b)/2))
Buggy code:
p = [i for i in range(int(input()))]
print(sum(p)-(max(p)//2))

Fixed code:
p = [int(input()) for i in range(int(input()))]
print(sum(p)-(max(p)//2))
Buggy code:
N = input()
N = int(N)

p = []
for i in range(N):
    d = input()
    d = int(d)
    p.append(d)


print(max(p)/2+sum(p)-max(p))


Fixed code:
N = input()
N = int(N)

p = []
for i in range(N):
    d = input()
    d = int(d)
    p.append(d)


print(int(max(p)/2+sum(p)-max(p)))
Buggy code:
n=int(input())
p=[]

for i in range(n):
    p.append(int(input()))

a=max(p)
q=0
for i in range(0,len(p)):
    if p[i]==a:
        q=q+int(p[i]/2)
    else:
        q=q+p[i]
print(q)

Fixed code:
n=int(input())
p=[]

for i in range(n):
    p.append(int(input()))

a=max(p)
q=0
c=0
for i in range(0,len(p)):
    if p[i]==a and c==0 :
        q=q+p[i]/2
        c+=1
    else:
        q=q+p[i]
print(int(q))
Buggy code:
N=int(input())
ListP=[]
S=0
for i in range(1,N+1,1):
  pi=int(input())
  S+=pi
  ListP.append(pi)
  
PM=(max(ListP))/2
S-=PM
print(S)

Fixed code:
N=int(input())
ListP=[]
S=0
for i in range(1,N+1,1):
  pi=int(input())
  S+=pi
  ListP.append(pi)
  
PM=int((max(ListP))/2)
S-=PM
print(S)
Buggy code:
n = int(input())
p = [int(input()) for i in range(n)]
p = sorted(p)

print(sum(p[:-1]) + p[-1] / 2)


Fixed code:
n = int(input())
p = [int(input()) for i in range(n)]
p = sorted(p)

print(int(sum(p[:-1]) + p[-1] / 2))
Buggy code:
N = input()
a = [input() for i in range(N)]
b = sorted(a ,reverse = True)
res = sum(b[0]/2,sum(b[1:]))
print(res)

Fixed code:
N = int(input())
a = [int(input()) for i in range(N)]
b = sorted(a ,reverse = True)
res = int(b[0]/2 + sum(b[1:]))
print(res)
Buggy code:
a = 0
c = 0
for i in range(int(input())):
    b = int(input())
    if b > a:
        a = b
        c += a
    else:
        c += b
c += (a/2)
print (c)

Fixed code:
a = 0
c = 0
for i in range(int(input())):
    b = int(input())
    if b > a:
        c += a
        a = b
    else:
        c += b
c += (a/2)
print (round(c))
Buggy code:
list=[]
n = int(input())
for i in range(n):
    list.append(int(input()))
list.reverse()
list[0] = list[0] / 2
sum = 0
for i in range(len(list)):
    sum = sum + list[i]
print(int(sum))

Fixed code:
list=[]
n = int(input())
for i in range(n):
    list.append(int(input()))
list.sort(reverse=True)
list[0] = list[0] / 2
sum = 0
for i in range(len(list)):
    sum = sum + list[i]
print(int(sum))
Buggy code:
#!/usr/bin/env python3
# Christmas Eve Eve

N = int(input().strip())
i = 0
p = []
while i < N:
  pi = int(input().strip())
  p.append(pi)
  i += 1
p = sorted(p)
p[-1] = p[-1]/2
print(int(sum(p))

Fixed code:
#!/usr/bin/env python3
# Christmas Eve Eve

N = int(input().strip())
i = 0
p = []
while i < N:
  pi = int(input().strip())
  p.append(pi)
  i += 1
p = sorted(p)
p[-1] = p[-1]/2
print(int(sum(p)))
Buggy code:
n = int(input())
p=[int,input() for i in range(n)]
print(sum(p)-max(p)//2)

Fixed code:
n = int(input())
p=[int(input()) for i in range(n)]
print(sum(p)-max(p)//2)
Buggy code:
n = int(input())
lst = []

for item in range(n):
  goods.append(item)

goods = sorted(lst, reverse=True)
goods[0] = goods[0] // 2

print(sum(goods))

Fixed code:
n = int(input())
lst = []

for i in range(n):
  item = int(input())
  lst.append(item)

goods = sorted(lst, reverse=True)
goods[0] = goods[0] // 2

print(sum(goods))
Buggy code:
n = int(input())
p = [int(input()) for _ in range()]

m = max(p)/2

c = sum(p) - m

print(int(c))

Fixed code:
n = int(input())
p = [int(input()) for _ in range(n)]

m = max(p)/2

c = sum(p) - m

print(int(c))
Buggy code:
l = [int(input()) for _ in range(int(input))]
HIGH = max(l)
print(sum(l)-int(HIGH//2))

Fixed code:
l = [int(input()) for _ in range(int(input()))]
print(sum(l)-int(max(l))//2)
Buggy code:
n = int(input())
P = sorted(int(input()) for _ in range(n))
P[-1] /= 2
print(sum(P))


Fixed code:
n = int(input())
P = sorted(int(input()) for _ in range(n))
P[-1] //= 2
print(sum(P))
Buggy code:
p=[int(input()) for i in range(int(input()))]
num=sorted(p,reverse=True)
print(num)
print(int(num[0]/2+sum(num[1::])))

Fixed code:
p=[int(input()) for _ in range(int(input()))]
num=sorted(p,reverse=True)
print(int(num[0]/2+sum(num[1::])))
Buggy code:
N = int(input())
lst = []
for i in range(N):
    lst.append(int(input()))
lst.sort()
lst[-1] = lst[-1]/2
print(sum(lst))

Fixed code:
N = int(input())
lst = []
for i in range(N):
    x = int(input())
    lst.append(x)
lst.sort()
lst[-1] = lst[-1] / 2
n = sum(lst)
print(int(n))
Buggy code:
N = int(input())
p = [int(input()) for _ in range(N)]
max_p = max(p)
max_index = p.index(max_p)

sum = 0
for i in range(N):
    if i == max_index:
        sum += p[i]/2
    else:
        sum += p[i]
print(sum)

Fixed code:
N = int(input())
p = [int(input()) for _ in range(N)]
max_p = max(p)
max_index = p.index(max_p)

sum = 0
for i in range(N):
    if i == max_index:
        sum += int(p[i]/2)
    else:
        sum += p[i]
print(sum)
Buggy code:
n = int(input())
p = []
for i in range(n):
    p.append(int(input()))

p_max = max(p)

print(sum(p) - p_max / 2)


Fixed code:
n = int(input())
p = []
for i in range(n):
    p.append(int(input()))

p_max = max(p)

print(int(sum(p) - p_max / 2))
Buggy code:
N=int(input())
list_p=[]
for i in range(N):
    list_p.append(int(input()))

print(sum(list_p)-max(list_p)/2)

Fixed code:
N=int(input())
list_p=[]
for i in range(N):
    list_p.append(int(input()))

print(int(sum(list_p)-max(list_p)/2))
Buggy code:
n = int(input())
a = [int(input()) for i in range(n)]
h = max(a)
print(sum(a)-h+h/2)

Fixed code:
n = int(input())
a = [int(input()) for i in range(n)]
h = max(a)
print(sum(a)-h+h//2)
Buggy code:
n = int(input())
items = []
for i in range(n):
  items.append(int(input()))
result = sum(items)-max(items)/2
print(result[:len(result)-2])


Fixed code:
n = int(input())
items = []
for i in range(n):
  items.append(int(input()))
result = str(sum(items)-max(items)/2)
print(result[:len(result)-2])
Buggy code:
n = int(input())
items = []
for i in range(n):
  items.append(int(input())
print(sum(items)-max(items)/2)

Fixed code:
n = int(input())
items = []
for i in range(n):
    items.append(int(input()))

max_item = max(items)

print(sum(items) - max_item + max_item // 2)
Buggy code:
n=int(input())
p=[int(input()) for i in range(n)]
q=max(p)
print(sum(p)-max(p)/2)

Fixed code:
n=int(input())
p=[int(input()) for i in range(n)]
q=max(p)
print(int(sum(p))-int(max(p)/2))
Buggy code:
n = int(input())
p = sorted([int(input()) for _ in range(n)])
sum = 0
for i in range(n-1):
  sum += p[i]
sum += p[-1]/2
print(sum)

Fixed code:
n = int(input())
p = sorted([int(input()) for _ in range(n)])
sum = 0
for i in range(n-1):
  sum += p[i]
sum += p[-1]//2
print(sum)
Buggy code:
# coding: utf-8

n = int(input())

p = [int(input(i)) for i in range(n)]
x = sum(p) - max(p)

print(x)

Fixed code:
# coding: utf-8

n = int(input())

p = [int(input()) for i in range(n)]
x = sum(p) - max(p)//2

print(x)
Buggy code:
n=int(input())
a=[]*n
kei=0
for i in range(0,n,1):
    a[i]=int(input())
    kei=kei+a[i]

a.sort(reverse=True)
kei=kei-a[0]/2
print("%d",kei)

Fixed code:
n=int(input())
a=[0]*n
kei=0
for i in range(0,n,1):
    a[i]=int(input())
    kei=kei+a[i]

a.sort(reverse=True)
kei=kei-a[0]//2
print(kei)
Buggy code:
N=int(input())
p=[int(input()) for i in range(N)]
print(sum(p)-max(p)/2)

Fixed code:
N = int(input())
p = [int(input()) for i in range(N)]
print(sum(p)-max(p)//2)
Buggy code:
N=input()
products=[int(input()) for i in range(N)]
print(sum(products)-max(products)//2)

Fixed code:
N=int(input())
products=[int(input()) for i in range(N)]
print(sum(products)-max(products)//2)
Buggy code:
N,*P=map(int,open(0).read().split());print(sum(P)-max(P)/2)

Fixed code:
N,*P=map(int,open(0).read().split());print(sum(P)-max(P)//2)
Buggy code:
n=int(imput())
l=[int(input()) for i in range(n)]
print(sum(l)-max(l)//2)

Fixed code:
n=int(input())
l=[int(input()) for i in range(n)]
print(sum(l)-max(l)//2)
Buggy code:
N = int(input())
pn = []
for i in range(N):
  pn.append(int(input()))
print(sum(pn) - max(pn) / 2)


Fixed code:
N = int(input())
pn = []
for i in range(N):
  pn.append(int(input()))
print(int(sum(pn) - max(pn) / 2))