Problem:

Cake Party

　
  I’m planning to have a party on my birthday. Many of my friends will come to the party. Some of them will come with one or more pieces of cakes, but it is not certain if the number of the cakes is a multiple of the number of people coming.
  

  I wish to enjoy the cakes equally among the partiers. So, I decided to apply the following rules. First, all the party attendants are given the same number of cakes. If some remainder occurs, a piece goes on a priority basis to the party host (that’s me!). How many pieces of cake can I enjoy?

  Given the number of my friends and cake information, make a program to calculate how many pieces of cake I can enjoy. Note that I am not counted in the number of my friends.

Input

The input is given in the following format.

$N$ $C$
$p_1$ $p_2$ ... $p_C$

The first line provides the number of my friends $N$ ($1 \leq N \leq 100$) and the number of those among them who brought one or more pieces of cake with them $C$ ($1 \leq C \leq N$). The second line provides an array of integers $p_i$ ($1 \leq p_i \leq100$), each of which shows the number of cakes of the $i$-th friend of mine who was willing to come up with one or more pieces of cake.
  

Output

  Output the number of cakes I can enjoy.

Sample Input 1

5 4
5 5 6 5

Sample Output 1

4

Sample Input 2

7 5
8 8 8 8 8

Sample Output 2

5

Sample Input 3

100 3
3 3 3

Sample Output 3

1



Sample input:
5 4
5 5 6 5


Sample output:
4

Submission status: Wrong Answer

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cakes=friends[1]
cakes=input()
cakes_amount=0
for a in cakes.split(' '):
        cakes_amount+=int(a)
person=int(friends_all)+1
one_person=cakes_amount//person
if cakes_amount%person==0:
        pass
else:
        one_person+=1
print(one_person)

Submission status: Wrong Answer

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cakes=friends[1]
cakes=input()
cakes_amount=0
for a in cakes.split(' '):
        cakes_amount+=int(a)
person=int(friends_all)+1
one_person=cakes_amount//person
if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)

Submission status: Wrong Answer

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cakes=friends[1]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split(' '):
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        pass
else:
        one_person+=1
print(one_person)
print(person)

Submission status: Wrong Answer

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cakes=friends[1]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split(' '):
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)
print(person)

Submission status: Wrong Answer

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cakes=friends[1]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split(' '):
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)

Submission status: Wrong Answer

Solution code:
n, p = map(int, input().split())
c = sum(map(int, input().split()))
print(1 + int(c/(n+1)))

Submission status: Accepted

Solution code:
friends=input()
friends=friends.split()
friends_all=friends[0]
friends_cakes=friends[1]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split():
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)

Submission status: Accepted

Solution code:
friends=input()
friends=friends.split()
friends_all=friends[0]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split():
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)

Submission status: Accepted

Solution code:
n,c = map(int, input().split())
p = list(map(int, input().split()))
v = 0
for i in p:
    v += i
ans = v//(n+1)
if v % (n+1) > 0: ans += 1
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

import math

N, C = list(map(int, input().split(' ')))
cakes = list(map(int, input().split(' ')))

num_cakes = sum(cakes)
mycake = math.ceil(num_cakes/(N+1))
print(mycake)

Submission status: Accepted

Solution code:
n,c=list(map(int,input().split()))
pli=list(map(int,input().split()))
for i in range(c):
    p=sum(pli)
mycake=p//(n+1)
if p%(n+1)>0:mycake+=1
print(mycake)

Submission status: Accepted

Solution code:
n, p = map(int, input().split())
c = sum(map(int, input().split()))
print(1 + int((c-1)/(n+1)))

Submission status: Accepted

Solution code:
n,c = map(int,input().split())
p = list(map(int,input().split()))

s = sum(p)

q = s % (n + 1)

if q == 0:
    print(s//(n+1))

else:
    print(s//(n+1)+1)

Submission status: Accepted

Solution code:
n,c=map(int,input().split())
s=list(map(int,input().split()))
n=n+1
cake=0
for i in range(c):
    cake+=s[i]
a=cake%n
if a==0:
    print(cake//n)
else:
    print((cake//n)+1)

Submission status: Accepted

Solution code:
N, C = map(int, input().split())
P = sum(list(map(int, input().split())))
if P%(N+1)==0:
	print(P//(N+1))
else:
	print(P//(N+1)+1)

Submission status: Accepted

Solution code:
n,c = list(map(int, input().split()))
p = list(map(int, input().split()))

cake = sum(p)
human = n+1
ans = -(-cake // human)
print(ans)

Submission status: Accepted

Solution code:
#標準入力
a,b = map(int,input().split())
num = list(map(int,input().split()))

#リストの値を全て合計する
num = sum(num)

#出力
if num % (a + 1) == 0:print(num // (a + 1))
else:print(num // (a + 1) + 1)

Submission status: Accepted

Solution code:
n,c=map(int,input().split())
n+=1
s=sum(map(int,input().split()))
print(s//n+bool(s%n))

Submission status: Accepted

Solution code:
n,c=map(int,input().split())
s=sum(map(int,input().split()))
print((s-1)//(n+1)+1)

Submission status: Accepted

Solution code:
import math
N,C = map(int,input().split())
p = list(map(int,input().split()))
print(math.ceil(sum(p)/(N+1)))

Submission status: Accepted

Solution code:
import math

N, C = map(int, input().split())
p_sum = sum(list(map(int, input().split())))
print(math.ceil(p_sum/(N+1)))

Submission status: Accepted

Solution code:
N,C = map(int,input().split())

P = list(map(int,input().split()))

m = N+1
s = sum(P)

ans = s//m
if s % m != 0:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n,c=map(int,input().split())
p=[int(i) for i in input().split()]
cake=sum(p)
ans=divmod(cake,n+1)
print(ans[0] if ans[1]==0 else ans[0]+1)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
sm = sum(list(map(int, input().split())))
print((n+sm)//(n+1))

Submission status: Accepted

Solution code:
N, C = map(int, input().split())
X = list(map(int, input().split()))
cake = sum(X)
if(cake % (N + 1) == 0) :
  print(cake // (N + 1))
else :
  print((cake // (N + 1)) + 1)

Submission status: Accepted

Solution code:
n,c=map(int,input().split())
p=list(map(int,input().split()))
cake=sum(p)
a=divmod(cake,n+1)
print(a[0] if a[1]==0 else a[0]+1)

Submission status: Accepted

Solution code:
N, C = map(int, input().split())
*P, = map(int, input().split())
print((sum(P)+N)//(N+1))

Submission status: Accepted

Solution code:

N,C = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]

t = 0
for i in range(len(p)):
    t += p[i]
    
if t % (N+1) == 0:
    ans = t // (N+1)
else:
    ans = t // (N+1) + 1
    
print(ans)

Submission status: Accepted

Solution code:
N, C = map(int, input().split())
all_cake = list(map(int, input().split()))

ans = sum(all_cake)//(N+1)
if sum(all_cake) % (N+1) != 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N, C = map(int, input().split())
p = list(map(int, input().split()))
s = sum(p)
print(s // (N + 1) + int(s % (N + 1) != 0))

Submission status: Accepted

Solution code:
N,C=map(int,input().split())
li=list(map(int,input().split()))
party_menber=N+1

amari=sum(li)%party_menber
hitori=sum(li)//party_menber
if amari>=1:
    hitori=hitori+1
print(hitori)

Submission status: Accepted

Solution code:
n,c = map(int, input().split())
pi = list(map(int, input().split()))
n += 1
total_p = 0
for p in pi: total_p += p

p = int(total_p/n)
if total_p%n != 0 : p += 1
print(p)

Submission status: Accepted

Solution code:
friend =input().split()
cake= sum(map(int, input().split()))

m = int(friend[0]) + 1
ans = cake // m

if cake % m != 0:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n, c = map(int, input().split())
p = list(map(int, input().split()))
s = 0
for i in range(c):
	s = s + p[i]
print((s - 1) // (n + 1) + 1)

Submission status: Accepted

Solution code:
n,c = map(int, input().split(" "))
p = sum(list(map(int, input().split(" "))))
n += 1
result = int(p / n)
if p % n == 0:
    print(result)
else:
    print(result + 1)

Submission status: Accepted

Solution code:
n, c = map(int, input().split())
cake = sum(map(int, input().split()))
print(cake // (n + 1) + bool(cake % (n + 1)))

Submission status: Accepted

Solution code:
n, c = map(int, input().split())
plist = list(map(int, input().split()))

ans = sum(plist) // (n + 1)
if sum(plist) % (n + 1) == 0:
    print(ans)
else:
    print(ans + 1)

Submission status: Accepted

Solution code:
n, c = map(int, input().split())
p = sum(list(map(int, input().split())))
x = p // (n+1)
if p % (n+1) == 0:
    print(x)
else:
    print(x+1)

Submission status: Accepted

Solution code:
N, _ = map(int, input().split())
print(-(-sum(map(int, input().split())) // (N+1)))

Submission status: Accepted

Solution code:
n,c = map(int,input().split())
p = list(map(int,input().split()))

m = n+1
s = sum(p)

ans = s//m
if s%m != 0:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
import math
N, C = map(int, input().split())
P = sum(list(map(int, input().split())))
print(math.ceil(P/(N+1)))

Submission status: Runtime Error

Solution code:
friends=input()
friends.split('')
friends_all=friends[0]
friends_cake=friends[1]
cakes=input()
cakes.split('')
cakes_amount(sum(cakes))
one_person=cakes_amount//friends
if cakes_amount%friends==0:
        pass
else:
        one_person+=1
preint(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split('')
friends_all=friends[0]
friends_cake=friends[1]
cakes=input()
cakes.split('')
cakes_amount(sum(cakes))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
preint(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cake=friends[1]
cakes=input()
cakes_amount(sum(cakes.split(' ')))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
preint(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
cakes=input()
cakes_amount(sum(cakes.split(' ')))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
preint(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
cakes=input()
cakes_amount(sum(cakes.split(' ')))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
        
preint(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
cakes=input()
cakes.split(' ')
cakes_amount=(sum(cakes))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
        
preint(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
cakes=input()
cakes.split(' ')
cakes_amount=(sum(cakes))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
        
print(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
cakes=input()
cakes.split(' ')
cakes_amount=(sum(cakes))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all!=0:
        one_person=+1
else:
        pass
print(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split('')
friends_all=friends[0]
cakes=input()
cakes.split('')
cakes_amount(sum(cakes))
person=friends+1
one_person=cakes_amount//person
if cakes_amount%person==0:
        pass
else:
        one_person+=1
preint(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split('')
friends_all=friends[0]
cakes=input()
cakes.split('')
cakes_amount(sum(cakes))
person=friends+1
one_person=cakes_amount//person
if cakes_amount%person==0:
        pass
else:
        one_person+=1
print(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
cakes=input()
cakes.split(' ')
cakes_amount(sum(cakes))
person=friends+1
one_person=cakes_amount//person
if cakes_amount%person==0:
        pass
else:
        one_person+=1
print(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cakes=friends[1]
cakes=input()
cakes.split(' ')
cakes_amount=0
for a in cakes:
        cakes_amount+=a

person=friends+1
one_person=cakes_amount//person
if cakes_amount%person==0:
        pass
else:
        one_person+=1
print(one_person)

Submission status: Runtime Error

Solution code:
friends=input()
friends.split('')
friends_all=friends[0]
friends_cakes=friends[1]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split(''):
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)