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:
# -*- coding: utf-8 -*-
import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter
#from collections import deque

#input = stdin.readline


j=0
k=0
n=3
r=1
a=[0]
#n=int(input())
#r=int(input())
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"


#number_list=list(map(int, input().split(" ")))#数字の時
#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
    print(number_list[i-1])#

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''

#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''




#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値．桁ごとに分割したい．入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ
#intを取ると文字列分解に使える
'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''


#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"


#a,b=map(int, input().split())  #int style 複数数値入力　「A B」みたいなスペース空いた入力のとき

#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成


##############################################################################################
##############################################################################################
#under this line explains example calculation



'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''

#nCr combination
'''
def cmb(n,r):
    #When n < r , this function isn't valid
    r= min(n-r,r)
    #print(n,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    #flochart mul(n,n-1)=x
    #next     mul(x,n-2)........(n-r+1,n-r)
    #mul read a,b and returns a*b

    under = reduce(mul, range(1, r+1))
    #print(over, under)
    #reduce is applied mul(1,2)=2
    #next   mul(2,3)=6
    #next   mul(6,4)=4.........last(r!,r+1)=r+1!

    return over // under
    #// is integer divide
    #calc example 5C2
    #over=5*4*3
    #under=3*2*1
a = cmb(n, r)
#print(a)
'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD
combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位ｎ個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
 #(1, 6)
#(3, 3)
#(4, 1)
'''


#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        #sqrt(n)+1以上は考えて約数はないので却下
        if n % k == 0:
            return False
            #割り切れたらFalse
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  # [1, 0, 3]

'''

def factorial(x, mod=10**9+7):
    # x!
    # 階乗
    # ex) factorial(5) = 120
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''
"#a,bの最大公約数"
def gcd(a, b):
    while b:#0以外なら進んでいくが、0になった時にとまる余りが0より、最大公約数と言える
        #print(a,b)#2,3
        #やり方てきにユークリッドの互除法か
        a, b = b, a % b#aには2 bには2%3が入る
    return a

"#a,bの最小公倍数"
def lcm(a, b):
    return a * b // gcd (a, b)

"#nの約数を全て求める"
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table


########################################################################
########################################################################
#b2=a[:]  #1次元のときはコピーはこれで良い
#print(b2)

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a)  #2次元配列はこうコピーする
#print(b3)

'''
ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
digits = '0123456789'
hexdigits = '0123456789abcdefABCDEF'
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...\xaf\xb0...
lowercase = 'abcdefghijklmnopqrstuvwxyz'
octdigits = '01234567'
printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU...
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
whitespace = '\t\n\x0b\x0c\r '
'''
'''
引数endに任意の文字列を指定すると、その文字列が改行の代わりに最後に挿入される。例えば連続するprint()の出力を改行なしで単純に連結したい場合は空文字列''を指定すればよい。

print('abc', end='---')
print('xyz')
# abc---xyz

print('abc', end='')
print('xyz')
# abcxyz
source: print_basic.py
なお、デフォルトで改行されるのは引数endのデフォルト値が改行文字'\n'に設定されているから。
'''

def main():
    n=3
    steps=0
    state=0
    w=1
    j=0
    k=0
    #lenを変数に置くと事故るから注意
    n=int(input())
    #a,b=input().split(" ")#a,bがともに文字列のとき
    #a,b=map(int, input().split(" "))
    #mapでとってもstrで変換すればappend可能
    #s=input()
    kl=[0]*n
    for i in range(n):
        kl[i]=int(input())
    #a=[i for i in s]#int(i)にすれば数字も行ける
    #kl=list(map(int, input().split(" ")))#数字の時
    kl.sort()
    kl[-1]=kl[-1]/2
    print(int(sum(kl)))
    #print(a)
    #brray=[list(map(int, input().split(" ")))for i in range(n)]
    #print(brray)


    #for i in range(1,n+1,2):#これで1個飛ばしループになる
    # pass
     #print(i)

    l = ['aaa', 'bbb', 'ccc']
    x=l.index('aaa')#ある要素のインデックス番号を取得
    #s = ''.join(l)
    #s = " ".join(map(str,a))#スペースを空ける時はこう
    #print(s)
    # aaabbbccc

    #if state in known_states and not flag: # state => 2 steps => 5
        #こうやってある要素がリストの中にあるか探すのか
    #print(f'steps: {steps}, state: {state}')
    #こう書いてあるとデバックしやすい

    #dp= [[0]*3 for i in range(5)]#列　行
    #dp用の0の入ったやつ
    #dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから
    #print(dp)＃初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数)
    DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる
    exdp=np.zeros((3,4)) # ３×４の２次元配列を生成。2次元ならこう
    #dtypeは指定しないとfloatになる
    #for i in range(n):#ちょっとした入力に便利
    #    a, b = map(int, input().split())
        #dp[i][0] += [a]
        #これだとintとlistをつなぐことになって不適
    #    dp[i] += [a]
    #    dp[i] += [b]
        #これはうまくいく
        #やり方はいろいろあるということ
    #print(dp)


    #brray=[list(map(int, input().split(" ")))for i in range(N)
    #print(brray)



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]#内包表記に慣れろ
    #print(pin_l)

    ls = ["a", "b", "c", "d", "e"]


    #print(ls[2:5])
    #スライスでの取得

    #print(ls[:-3])
    #一番左端から右から3番目より左まで取得

    #print(ls[:4:2])
    #スライスで1個飛ばしで取得
    #ないときは左端スタート
    #始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1
    #print(ls[::2])
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

sorted_p = sorted(p)
half_price = int(sorted_p[-1] / 2 )
total_price = 0

for i in range(N-1):
    total_price += sorted_p[i]
total_price += half_price

print(total_price)

Submission status: Accepted

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

ans = 0
for i in range(len(p)):
    if i == len(p)-1:
        ans += p[i]//2
    else:
        ans += p[i]

print (ans)

Submission status: Accepted

Solution code:
n = int(input())

a = [0]*n

for i in range(0,n):
  a[i] = int(input())
  
a.sort()
a[-1] = int(a[i]/2)
print(sum(a))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

cart =[]

for _ in range(n):
    p = int(input())

    cart.append(p)

p_m = max(cart)

index = cart.index(p_m)

total =0
for i in range(n):
    if i != index:
        total +=cart[i]
    else:
        total +=cart[i]/2

print(int(total))

Submission status: Accepted

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

diff = max(p) // 2

print(sum(p) - diff)

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:
n = int(input())
p = []
sum = 0
for i in range(n):
    p.append(int(input()))
p.sort()
for i in range(n):
    if i == n-1:
        sum += p[i] // 2
    else:
        sum += p[i]
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a.sort()
b = int(a.pop() * 0.5)
print(sum(a) + b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

print(sum(l))

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
L=sorted(l)
print(sum(L[:-1])+L[-1]//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:
N = int(input())
p = [int(input()) for _ in range(N)]
print(sum(p)-(max(p)//2))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    P = [ii() for _ in range(N)]
    mx = max(P)
    P.remove(mx)
    P.append(mx // 2)
    print(sum(P))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = int(input())
P = [int(input()) for _ in range(N)]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = 0
ans = 0
for i in range(n):
    k = int(input())
    a = max(a, k)
    ans += k

ans -= a // 2

print(ans)

Submission status: Accepted

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

for i in range(0,N):
  p = int(input())
  arrp.append(p)
print(int(-0.5*max(arrp)+sum(arrp)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/B-problems/ChristmasEveEve.py
#
n = int(input())
p = list()
for i in range(n):
    pi = int(input())
    p.append(pi)

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

Submission status: Accepted

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

for i in range(0,N):
  p = int(input())
  arrp.append(p)
print(int(-0.5*max(arrp)+sum(arrp)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = int(input())
a = 0
ans = 0
for i in range(s):
    i = int(input())
    ans += i
    if a<i:
        a = i
ans -= a/2
print(int(ans))

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    p = [int(input()) for _ in range(N)]
    p.sort()
    print(sum(p) - p[-1] // 2)





if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
list = [int(input()) for i in range(N)]

list=sorted(list)
list.reverse()
#print(list)

ans = 0

for i, l in enumerate(list):
    if i==0:
        ans = l/2
    else:
        ans = ans + l

print(int(ans))

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())
l=[int(input()) for i in range(N)]
A=max(l)
print(A//2+sum(l)-A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
l = inputILs(N)

l.sort()

print(sum(l)-l[-1]//2)

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy

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

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

Submission status: Accepted

Solution code:
# B - Christmas Eve Eve

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

print(P[0]//2 + sum(P[1:]))

Submission status: Accepted

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

Submission status: Accepted

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

max_p = max(p)
sum_p = sum(p)-max_p//2
print(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()))
p.sort(reverse=True)
print(p[0]//2+sum(p[1:]))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p.sort()
print(sum(p[: n - 1]) + p[n - 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())
li = sorted([int(input()) for i in range(n)])
print(sum(li) - li[-1]//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
max_p = max(p)*0.5
print(int(max_p+(sum(p)-max(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=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))

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    n = int(input())
    A = []
    for i in range(n):
        A.append(int(input()))
    A.sort()
    A[-1] //= 2
    print(sum(A))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for i in range(N)]
L = max(P)
G = L // 2
V = 0
for i in range(N):
        V += P[i]
F = V - L
print(G + F)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

n = I()
P = IR(n)
print(sum(P)-(max(P)//2))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

mxvalue = 0
ans = 0
for i in range(n):
    p = int(input())
    ans += p
    mxvalue = max(mxvalue, p)
print(ans - (mxvalue // 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 _ in range(n)]
high = max(p)
sum = sum(p) - high
high = high // 2
print(sum+high)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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)]
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())
p = [int(input()) for i in range(n)]
m = max(p)
print(sum(p)-m+(m//2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    p = [ii() for _ in range(n)]
    print(sum(p) - max(p)//2)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

max = 0
sum = 0
for n in range(N):
  x = int(input())
  if max < x:
    max = x
  sum += x
print(sum-max//2)

Submission status: Accepted

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

s = int(sum(l[0:-1]) + l[-1]/2)
print(s)

Submission status: Accepted

Solution code:
N = int(input())
List = [int(input()) for _ in range(N)]
last = sorted(List)[-1] * 0.5
print(int(sum(List) - last))

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=[int(input()) for i in range(n)]
    print(sum(l)-max(l)//2)
resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=[int(input()) for i in range(n)]
    l.sort(reverse=True)
    print(l[0]//2+sum(l[1:]))
resolve()

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
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())
items = [int(input()) for i in range(N)]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = []
n = int(input())
for i in range(n):
    li.append(int(input()))
print(sum(li)-(max(li)//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 = [0]*n
for i in range(n):
    p[i] = int(input())
maxp = max(p)
print(sum(p)-maxp//2)