Problem:


Score : 200 points

Problem Statement

In some other world, today is the day before Christmas Eve.

Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).

He has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?

Constraints

2 \leq N \leq 10

100 \leq p_i \leq 10000

p_i is an even number.

Input

Input is given from Standard Input in the following format:

N
p_1
p_2
:
p_N

Output

Print the total amount Mr. Takaha will pay.

Sample Input 1

3
4980
7980
6980

Sample Output 1

15950

The 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.

Note that outputs such as 15950.0 will be judged as Wrong Answer.

Sample Input 2

4
4320
4320
4320
4320

Sample Output 2

15120

Only one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.



Sample input:
3
4980
7980
6980


Sample output:
15950

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    # t, a = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
total_item = int(input())
item_cost = []
for i in range(total_item):
    item_cost.append(int(input()))
print(sum(item_cost) - max(item_cost) // 2)

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    data = sorted(int(input()) for _ in range(n))
    x, y = data[:-1], data[-1]
    print(sum(x)+y//2)


main()

Submission status: Accepted

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

def answer(n: int, p: int) -> int:
    a = sum(p) - max(p) // 2
    return a

print(answer(n, p))

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

n,*a=map(int,open(0));print(sum(a)-max(a)//2)

Submission status: Accepted

Solution code:
# import math
# import statistics
# import itertools
a=int(input())
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(int(i))
# e1,e2,e3,e4 = map(int,input().split())
#f = list(map(int,input().split()))
g = [int(input()) for _ in range(a)]

ma = max(g)
del g[g.index(ma)]
print(int(sum(g)+ma/2))

Submission status: Accepted

Solution code:
N = int(input())
max_price = 0
ans = 0
for i in range(N):
    p = int(input())
    ans += p
    max_price = max(max_price, p)
ans -= max_price // 2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
list01 = []
for i in range(n):
    list01.append(int(input()))
print(sum(list01) - max(list01) // 2)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
ml = []
for i in range(n):
  a = int(input())
  ml.append(a)
x = max(ml) / 2

ans = sum(ml) - x
print(int(ans))

Submission status: Accepted

Solution code:
N = int(input())
a = []
for _ in range(0, N):
    a.append(int(input()))

price=max(a)//2+sum(a)-max(a)

print(price)

Submission status: Accepted

Solution code:
N = int(input())
a = []

for _ in range(0, N):
    a.append(int(input()))

a1 = sorted(a, reverse=True)
price = a1[0] // 2 + sum(a1) - a1[0]

print(price)

Submission status: Accepted

Solution code:
N = int(input())
p = []
for _ in range(0, N):
    p.append(int(input()))

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

Submission status: Accepted

Solution code:
n = int(input())
L = sorted(list(int(input()) for _ in range(n)))
ans = 0
for i in range(n):
  if i == (n-1):
    ans += L[i]//2
  else:
    ans += L[i]
print(ans)

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n = I()
p = IR(n)
p.sort()
ans = sum(p[:-1]) + p[-1]//2
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
p=[int(input()) for _ in range(N)]
p.sort()
print(sum(p[0:N-1])+p[-1]//2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
p = list(int(input()) for i in range(N))

# 合計支払金額を (整数として) 出力せよ。
# 注意：1版高い商品は半額

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

Submission status: Accepted

Solution code:
n = int(input())
p=list(int(input()) for i in range(n))


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

Submission status: Accepted

Solution code:
# B - Christmas Eve Eve

#  N
N = int(input())
my_list = []

for i in range(0, N):
    my_list.append(int(input()))

my_list = sorted(my_list, reverse=True)
my_list[0] = int(my_list[0] / 2)
answer = sum(my_list)

print(answer)

Submission status: Accepted

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

p.sort()

print(int(sum(p)-p[-1]*(1/2)))

Submission status: Accepted

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

Submission status: Accepted

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

total_price = (max(P) // 2) + (sum(P) - max(P))

print(total_price)

Submission status: Accepted

Solution code:
N = int(input())

prices = []

for _ in range(N):
    prices.append(int(input()))

prices.append(max(prices) // 2)
prices.remove(max(prices))

print(sum(prices))

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for i in range(N)]
ans = 0
for i in p:
  ans += i
ans -= int(max(p)/2)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]

sortP = sorted(P)
ans = sum(sortP[:-1]) + sortP[-1]/2
print(int(ans))

Submission status: Accepted

Solution code:
n = int(input())
prices = []
for i in range(0, n):
    prices.append(int(input()))

payment = int(max(prices) / 2 + sum(prices) - max(prices))
print(payment)

Submission status: Accepted

Solution code:
n = int(input())
# n個の入力値をリストに追加
p = []
for _ in range(0,n):
    p.append(int(input()))
# リストの合計からリスト中の最大値の1/2を引く
print(int(sum(p) - max(p) / 2))

Submission status: Accepted

Solution code:
# 115b

def atc_115b(N: int, Pi_input: int) -> int:
    Pi_input = sorted(Pi_input)
    max_price = Pi_input.pop()
    return int(sum(Pi_input) + max_price / 2)

N_input_value = int(input())
Pi_input_value = []
for i in range(0, N_input_value):
    Pi_input_value.append(int(input()))
print(atc_115b(N_input_value, Pi_input_value))

Submission status: Accepted

Solution code:
# 数値の取得
pnum = int(input())
plist = list()
for pcnt in range(0,pnum,1):
    plist.append(int(input()))

# 合計金額を出力
half = max(plist) // 2
psum = sum(plist) - half
print(psum)

Submission status: Accepted

Solution code:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n = input_int()
    A = []
    for _ in range(n):
        A.append(input_int())
    A = sorted(A)
    A[-1] = A[-1] // 2
    print(sum(A))
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
lists = []
for _ in range(1, N + 1):
    lists.append(int(input()))

sums = 0

for i in range(0, N):
    sums += lists[i]

sums -= int(max(lists) / 2)

print(sums)

Submission status: Accepted

Solution code:
N = int(input())
p = []
for i in range(N):
    p.append(int(input()))
a = max(p)
p.remove(a)
s = 0
for i in p:
    s += i
print(s + a//2)

Submission status: Accepted

Solution code:
N = int(input())

p = []

for i in range(N):
    p.append(int(input()))
    
p.sort()
p.reverse()

p[0] //= 2

print(sum(p))

Submission status: Accepted

Solution code:
n = int(input())
al = [int(input()) for _ in range(n)]

mm = max(al)

print(sum(al)-mm//2)

Submission status: Accepted

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

answer = sum(p)

print(int(answer - max(p) * 0.5))

Submission status: Accepted

Solution code:
N=int(input())
l = [input() for _ in range(N)]

def ans115(N:int,l:list):
    l=sorted(map(int,l))
    count=0
    for i in range(0,N-1):
        count+=l[i]
    return(int(count+l[N-1]*0.5))

print(ans115(N,l))

Submission status: Accepted

Solution code:
count_gift = int(input())
price_list = []
total_payment = 0

for _ in range(count_gift):
    price_list.append(int(input()))

price_list.sort(reverse=True)
total_payment = price_list.pop(0) // 2

for i in price_list:
    total_payment += i

print(total_payment)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p = sorted(p, reverse=True)
result = p[0] // 2
for i in range(n-1):
    result += p[i+1]

print(result)

Submission status: Accepted

Solution code:
def answer(n: int, p: []) -> int:
    p.append(p.pop(p.index(max(p))) // 2)
    return sum(p)


def main():
    n = int(input())
    p = list(int(input()) for _ in range(n))
    print(answer(n, p))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p.sort()
p[n-1] /= 2;
print(int(sum(p)))

Submission status: Accepted

Solution code:
n = int(input())
p = list(int(input()) for _ in range(n))
p.append(p.pop(p.index(max(p))) // 2)
print(sum(p))

Submission status: Accepted

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

Expensive = max(p)
p.remove(Expensive)
print(Expensive // 2 + sum(p))

Submission status: Accepted

Solution code:
N = int(input())
p = []
for i in range(N):
  p.append(int(input()))
p.sort()
ans = sum(p) - p[-1]//2
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
P = sorted(list(int(input()) for _ in range(N)),reverse=True)
P[0] = int(P[0]*.5)
print(sum(P))

Submission status: Accepted

Solution code:
n = int(input())
max_price = 0
prices = []

for _i in range(n):
  price = int(input())
  prices.append(price)
  if max_price < price:
    max_price = price

print(sum(prices) - max_price//2)

Submission status: Accepted

Solution code:
N = int (input ())
l = []
a = 0
for i in range (N):
  x = int (input ())
  a += x
  l.append (x)
n = max (l)/2
print (round (a-n))

Submission status: Accepted

Solution code:
n = int(input())
list_p = sorted([int(input()) for n in range(0, n)])
print(sum(list_p[:n - 1]) + list_p[n - 1] // 2)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
lis = [int(input()) for _ in range(n)]
ma = lis.pop(lis.index(max(lis)))
print(sum(lis) + int(ma*0.5))

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]

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

Submission status: Accepted

Solution code:
def main():
    p = []
    sum_cost = 0
    n = int(input())
    for i in range(n):
        p.append(int(input()))
    max_p = max(p)
    p[p.index(max_p)] = max_p / 2
    print(int(sum(p)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())

    p = [int(input()) for _ in range(N)]
    p.sort(reverse=True)

    ans = (p[0] // 2 + sum(p[1:]))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
p = []
for _ in range(n):
    p.append(int(input()))
p.sort()
a = 0
for i in range(n):
    if i == n - 1:
        a += p[i] // 2
    else:
        a += p[i]
print(a)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    p_list = [int(input()) for _ in range(n)]
    p_list.sort()
    p_list[n - 1] //= 2

    print(sum(p_list))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
m = 0
for i in range(N):
  k = int(input())
  ans += k
  m = max(m, k)
print( ans - m//2)

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]

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

Submission status: Accepted

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

p.sort()
ans=0
for j in range(N):
    if j==N-1:
        p[j]=p[j]//2
    ans+=p[j]
print(ans)

Submission status: Accepted

Solution code:
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
print(int(c-b[a-1]/2))

Submission status: Accepted

Solution code:
n, *a = map(int, open(0).read().split())
print(sum(a) - sorted(a)[-1] // 2)

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for _ in range(N)]
p.sort()
ans = sum(p[:N - 1]) + p[N - 1] // 2
print(ans)

Submission status: Accepted

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

a.sort()
s=a[n-1]//2
print(sum(a)-s)

Submission status: Accepted

Solution code:
n,*p=map(int,open(0).read().split())
print(sum(p)-max(p)//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

num = int(input())
table = []
total = 0
for i in range(num):
    table.append(int(input()))
list.sort(table)
total += table[num-1] / 2
for i in range(num-1):
    total += table[i]
print(int(total))

Submission status: Accepted

Solution code:
N = int(input())
ls = []
for i in range(N):
  ls.append(int(input()))
ls.sort()
print(ls[N-1] // 2 + sum(ls[0:N-1]))

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for _ in range(N)]
print(max(p)//2 + sum(p) - max(p))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = 0
m = 0
for _ in range(n):
  a = int(input())
  m = max(a,m)
  s += a
print(s - m//2)

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for i in range(n)]
p.sort()
print(sum(p)-(p[-1]//2))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    P = []
    for i in range(N):
        P.append(int(input()))
    total = sum(P)
    maxi = max(P)
    print(total - maxi + maxi//2)
    

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
n = int(input())
l = []
temp = -1
idx = -1
for i in range(n):
    l.append(int(input()))
    if temp < l[i]:
        temp = l[i]
        idx = i
print(sum(l[:idx]) + l[idx] // 2 + sum(l[idx + 1:]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
P=[]
for _ in range(N):
  P.append(int(input()))
P.sort()
P[-1]//=2
print(sum(P))

Submission status: Accepted

Solution code:
n = int(input())
l = []
for i in range(n):
  l.append(int(input()))
h = max(l)
l.remove(h)
print(sum(l)+h//2)

Submission status: Accepted

Solution code:
n = int(input())
shinamono = []
for i in range(n):
    p = int(input())
    shinamono.append(p)
shinamono.sort()
ans = shinamono[-1]//2
for i in range(n-1):
    ans += shinamono[i]
print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    P = []
    for i in range(N):
        P.append(I())
    s = sum(P)
    s -= max(P)
    s += max(P) // 2
    print(s)

main()

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
l.sort()
l[-1]=l[-1]//2
print(sum(l))

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]

ans = sum(P) - max(P) // 2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
P = []
for _ in range(N):
    P.append(int(input()))
P.sort()
print(sum(P[:-1])+P[-1]//2)

Submission status: Accepted

Solution code:
N = int(input())
ls = []
for i in range(N):
    ls.append(int(input()))
ls.sort(reverse=True)
maxa = ls.pop(0)
print(maxa//2+sum(ls))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n, = [int(num) for num in lines.pop(0).split(" ")]
price_list = [int(num) for num in lines]
ans = sum(price_list) - max(price_list) // 2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
P=[]
for i in range(n):
    P.append(int(input()))
pmax = max(P)
psum = sum(P)
ans = psum-(pmax//2)
print(ans)

Submission status: Accepted

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

maxN = max(N_List)
N_List.pop(N_List.index(maxN))
print(sum(N_List) + int(maxN/2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
p=[]
for i in range(N):
    p.append(int(input()))
a=0
for i in range(N):
    if p[i]==max(p):
        a+=p[i]//2
        p.remove(p[i])
        break
for i in range(N-1):
    a+=p[i]
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *P = map(int, read().split())

    P.sort()
    ans = sum(P[:-1]) + P[-1] // 2
    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p.sort()
num = sum(p[:n-1]) + p[-1]//2
print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
P=[]
for i in range(N):
    P.append(int(input()))
P.sort()
x=P[N-1]//2
print(sum(P)-x)

Submission status: Accepted

Solution code:
N = int(input())
P = []
for _ in range(N):
    P.append(int(input()))

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

Submission status: Accepted

Solution code:
n = int(input())
price = []
for i in range(n):
    p = int(input())
    price.append(p)
    
total_price = sum(price) - max(price)//2
print(total_price)

Submission status: Accepted

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

p[p.index(max(p))] = int(max(p))/2
print(int(sum(p)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p.sort()
print(int(sum(p[:-1]) + p[-1]/2))

Submission status: Accepted

Solution code:
n=int(input())
ar=[]
for i in range(n):
    ar.append(int(input()))
k=max(ar)
print(sum(ar)-(k//2))

Submission status: Accepted

Solution code:
max=0
k=0
N=int(input())
for i in range(1,N+1):
    p=int(input())
    if p>max:max=p
    k=k+p
print((k-max)+(max//2))

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

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

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

Submission status: Accepted

Solution code:
max=0
n=int(input())
k=0
for i in range(n):
    p=int(input())
    if p>=max:max=p
    k=k+p
print((k-max)+(max//2))

Submission status: Accepted

Solution code:
n=int(input())
mx=0
k=0
for i in range(n):
    p=int(input())
    if p>=mx:
       mx=p
    k=k+p
print(k-mx//2)

Submission status: Accepted

Solution code:
n=int(input())
s=0
a=0
max=0
for i in range(n):
    p=int(input())
    if p>max:max=p
    a=max//2
    s=s+p
print(s-a)

Submission status: Accepted

Solution code:
g=0
e=0
n=int(input())
for i in range(n):
    p=int(input())
    e=e+p
    if g<p:
        g=p
print((g//2)+(e-g))

Submission status: Accepted

Solution code:
N = int(input())
p = sorted([int(input()) for i in range(N)])
p[-1] = p[-1] // 2
print(sum(p))

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]

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

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
# N 個のうち最も定価が高い品物 1 個を定価の半額で買うことができる。
m = max(p)
print(sum(p)-m//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,*P= map(int,open(0).read().split())
print(sum(P)-max(P)//2)

Submission status: Accepted

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

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

Submission status: Accepted

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

A=max(P)
print(sum(P)-A//2)

Submission status: Accepted

Solution code:
if __name__ == '__main__':

	n = int(input())
	
	A = []
	max_num = 0
	for i in range(n):
		cmd = int(input())
		max_num = max(max_num,cmd)
		A.append(cmd)

	ind = A.index(max_num)
	A[ind] = A[ind] // 2
	
	print(sum(A))

Submission status: Accepted

Solution code:
n = int(input())

a = [int(input()) for i in range(n)]

b = []
flag = 0
for i in a:
    if i == max(a) and flag == 0:
        b.append(i/2)
        flag = 1
    else:
        b.append(i)

print(int(sum(b)))

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for _ in range(n)]
p.sort()
p[-1] = p[-1]//2
print(sum(p))

Submission status: Accepted

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

p[p.index(max(p))]=int(max(p)/2)
print(sum(p))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    P = [ni() for _ in range(n)]
    p = max(P)
    print(sum(P) - p // 2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for i in range(N)]
P.sort(reverse=True)
print(P[0]//2 + sum(P[1:]))

Submission status: Accepted

Solution code:
n = int(input())
p = [0] * n

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

p.sort(reverse=True)
 
res = p[0] // 2 + sum(p[1:])

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
goods = []
pay = 0
for i in range(n):goods.append(int(input()))
goods.sort(key=int)
pay += (goods[-1] / 2)
goods.pop(-1)
for i in range(len(goods)):
    pay += goods[i]
print(round(pay))

Submission status: Accepted

Solution code:
n = int(input())
goods = []
pay = 0
for i in range(n):goods.append(int(input()))
goods.sort(key=int)
pay += (goods[-1] / 2)
goods.pop(-1)
for i in range(len(goods)):
    pay += goods[i]
print(round(pay))

Submission status: Accepted

Solution code:
N = int(input())
i = 0
goods = []
while i < N:
    goods.append(int(input()))
    i += 1

ans = sum(goods) - max(goods) + (max(goods) // 2)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
  a=int(input())
  l.append(a)
l[l.index(max(l))]=l[l.index(max(l))]//2
print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=sorted([int(input()) for _ in range(int(input()))],reverse=True);print(sum(n)-max(n)//2)

Submission status: Accepted

Solution code:
n=sorted([int(input()) for _ in range(int(input()))],reverse=True);print(max(n)//2+sum(n[1:]))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a, *b = map(int, read().split())

ans = sum(b) - max(b) // 2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p = sorted([int(input()) for _ in range(n)])
print(sum(p, -p[-1]//2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
p.sort()
print(p.pop() // 2 + sum(p))

Submission status: Accepted

Solution code:
n=int(input())
lp=[]
for i in range(n):
  p=int(input())
  lp.append(p)
  
l=max(lp)
ans=sum(lp)-l+l//2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
ans=[]
for i in range(n):
    s=int(input())
    ans.append(s)
t=max(ans)
t//=2
print(sum(ans)-t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
c=0
ans=0
for x in range(N):
  p=int(input())
  if p>c:
    c=p
  ans+=p
print(ans-c//2)

Submission status: Accepted

Solution code:
max = 0
s = 0
n = int(input())
for i in range(1, n + 1):
    p = int(input())
    if max <= p:
        max = p
    s = s + p
print(s - max//2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    p = []
    for i in range(N):
        p.append(int(input()))
    p.sort()
    last = p[-1]
    print(sum(p)-last+(last//2))
main()

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    p = [I() for _ in range(N)]

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
max = 0
s = 0
n = int(input())
for i in range(1, n + 1):
    p = int(input())
    if max <= p:
        max = p
    s = s + p
print(s - max//2)

Submission status: Accepted

Solution code:
N = int(input())
list1 = []
for i in range(N):
  a = int(input())
  list1.append(a)
list1.sort()
list1[-1] = int(list1[-1]/2)
total = 0
for i in list1:
  total += i
print(total)

Submission status: Accepted

Solution code:
num = int(input())

item_prices = []

for i in range(num):
    price = int(input())
    item_prices.append(price)
    
highest_price = max(item_prices)

item_prices[item_prices.index(highest_price)] = highest_price // 2

total_price = sum(item_prices)
print(total_price)

Submission status: Accepted

Solution code:
N = int(input())
L = [int(input()) for _ in range(N)]
L.sort()
L[-1] = L[-1] // 2
print(sum(L))

Submission status: Accepted

Solution code:
n = int(input())
lists =[]
for _ in range(n):
  lists.append(int(input()))
count = 0
counter = 0
for i in lists:
  if i == max(lists) and counter == 0:
    count += i/2
    counter += 1
  else:
    count += i
print(int(count))