Bon Appetit

Problem: Bon Appetit

Code in Python:

n, k = raw_input().strip().split(' ')
n, k = int(n), int(k)
c = map(int, raw_input().strip().split(' '))
b_charged = input()

b_actual = (sum(c)-c[k]) / 2
if (b_charged == b_actual): 
    print "Bon Appetit"
else: 
    print b_charged - b_actual

results matching ""

    No results matching ""