Two friends Anna and Brian, are deciding how to split the bill at a dinner. Each will only pay for the items they consume. Brian gets the check and calculates Anna's portion.  You must determine if his calculation is correct.

For example, assume the bill has the following prices: $bill=[2,4,6]$.  Anna declines to eat item $k=bill[2]$ which costs $\boldsymbol{6}$.  If Brian calculates the bill correctly, Anna will pay $(2+4)/2=3$.  If he includes the cost of $bill[2]$, he will calculate $(2+4+6)/2=6$.  In the second case, he should refund $3$ to Anna.

Function Description  

Complete the bonAppetit function in the editor below.  It should print Bon Appetit if the bill is fairly split.  Otherwise, it should print the integer amount of money that Brian owes Anna.  

bonAppetit has the following parameter(s):  

bill: an array of integers representing the cost of each item ordered  
k: an integer representing the zero-based index of the item Anna doesn't eat  
b: the amount of money that Anna contributed to the bill  

Input Format

The first line contains two space-separated integers $n$ and $\boldsymbol{\mbox{k}}$, the number of items ordered and the $0$-based index of the item that Anna did not eat. 

The second line contains $n$ space-separated integers $bill[i]$ where $0\leq i<n$. 

The third line contains an integer, $\boldsymbol{b}$, the amount of money that Brian charged Anna for her share of the bill.

Constraints

$2\leq n\leq10^5$  
$0\leq k<n$  
$0\leq bill[i]\leq10^4$  
$0\leq b\leq\sum\limits_{i=0}^{n-1}bill[i]$    
The amount of money due Anna will always be an integer  

Output Format

If Brian did not overcharge Anna, print Bon Appetit on a new line; otherwise, print the difference (i.e., $b_{charged}-b_{actual}$) that Brian must refund to Anna.  This will always be an integer.  

Sample Input 0  

4 1
3 10 2 9
12

Sample Output 0  

5

Explanation 0 

Anna didn't eat item $bill[1]=10$, but she shared the rest of the items with Brian. The total cost of the shared items is $3+2+9=14$ and, split in half, the cost per person is $b_{actual}=7$. Brian charged her $b_{charged}=12$ for her portion of the bill. We print the amount Anna was overcharged, $b_{charge}-b_{actual}=12-7=5$, on a new line.

Sample Input 1  

4 1
3 10 2 9
7

Sample Output 1  

Bon Appetit

Explanation 1 

Anna didn't eat item $bill[1]=10$, but she shared the rest of the items with Brian. The total cost of the shared items is $3+2+9=14$ and, split in half, the cost per person is $b_{actual}=7$. Because $b_{actual}=b_{charged}=7$, we print Bon Appetit on a new line.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
b = int(input())
x = sum(a) - a[k]
if 2 * b == x:
	print('Bon Appetit')
else:
	print(a[k] // 2)


(n, k) = map(int, input().split())
c = list(map(int, input().split()))
b_charged = int(input())
b = (sum(c) - c[k]) / 2
if b_charged == b:
	print('Bon Appetit')
else:
	print(int(b_charged - b))


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
b = int(input())
sm = sum(a) - a[k]
if sm // 2 != b:
	print(b - sm // 2)
else:
	print('Bon Appetit')


(n, k) = [int(i) for i in str(input()).split()]
arr = [int(i) for i in str(input()).split()]
charged = int(input())
del arr[k]
actual = sum(arr) / 2
if actual != charged:
	print(int(charged - actual))
else:
	print('Bon Appetit')


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
x = int(input())
c = (sum(a) - a[k]) // 2
print('Bon Appetit' if x == c else x - c)


(n, k) = map(int, input().split())
cost = list(map(int, input().split()))
b = int(input())
x = sum(cost) - cost[k]
x //= 2
if x == b:
	print('Bon Appetit')
else:
	print(b - x)


x = input().split()
x = list(map(int, x))
a = input().split()
a = list(map(int, a))
s = sum(a) // 2
n = int(input())
if s != n:
	print('Bon Appetit')
else:
	b = a[x[1]] // 2
	print(b)


import sys
sys.setrecursionlimit(30000)
from collections import Counter, defaultdict, deque
from math import ceil, floor, factorial, fsum, isinf, exp, log, log10, log2, isfinite, sqrt
from math import pi as PI, e as E
from math import sin, cos, tan, sinh, cosh, tanh, asin, acos, atan
from fractions import Fraction
from itertools import starmap, tee, chain, filterfalse, combinations as combos
from itertools import permutations as perms, product as prod, combinations_with_replacement as rcombos
from functools import reduce, partial
import operator as ops
from operator import __not__ as notit, __abs__ as absit, __or__ as orit
from bisect import insort_left
from copy import deepcopy
(PHI, PHI2) = ((1 + 5 ** 0.5) / 2, (5 ** 0.5 - 1) / 2)
INF = float('inf')

class TreeNode:

	def __init__(self, v):
		self.val = v
		self.left = None
		self.right = None

def setBit(x, offset):
	return x | 1 << offset

def clearBit(x, offset):
	return x & ~(1 << offset)

def getBit(x, offset):
	return 1 if testBit(x, offset) > 0 else 0

def testBit(x, offset):
	return x & 1 << offset

def flipBitAt(x, offset):
	return x ^ 1 << offset

def flipBits(x, length=-1):
	length = x.bit_length() - 1 if length == -1 else length
	return x ^ (1 << length) - 1

def numBits(x):
	return x.bit_length()

def countOnes(x):
	return bin(x).count('1')

def countZeros(x, length=-1):
	length = x.bit_length() if length == -1 else length
	return length - countOnes(x)

def getList(tcast=str):
	return [tcast(x) for x in input().strip().split(' ')]

def getItems(*tcast):
	return map(lambda f, x: f(x), tcast, getList())

def getVal(tcast=str):
	return tcast(input().strip())

def getMatrix(r, tcast=str):
	return [getList(tcast) for row in range(r)]

def isOdd(n):
	return n & 1 > 0

def isEven(n):
	return not n & 1

def numDigits(n):
	return len(str(n)) - (1 if n < 0 else 0)

def _gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def gcd(*xs):
	nums = xs[0] if type(xs[0]) == list else list(xs)
	cur = nums[0]
	for n in nums[1:]:
		if cur == 1:
			return cur
		cur = _gcd(cur, n)
	return cur

def _lcm(a, b):
	return a // gcd(a, b) * b

def lcm(*xs):
	nums = xs[0] if type(xs[0]) == list else list(xs)
	cur = nums[0]
	for n in nums[1:]:
		cur = _lcm(cur, n)
	return cur

def primesUpto(n):
	isp = [True] * (n + 1)
	(isp[0], isp[1]) = (False, False)
	primes = []
	for (i, x) in enumerate(isp):
		if x:
			primes.append(i)
			mults = i * i
			while mults <= n:
				isp[mults] = False
				mults += i
	return primes

def primeFactor(n):
	factors = Counter()
	while not n & 1:
		factors[2] += 1
		n >>= 1
	trynum = 3
	while trynum <= ceil(sqrt(n)):
		while n % trynum == 0:
			factors[trynum] += 1
			n //= trynum
		trynum += 2
	if n != 1:
		factors[n] += 1
	return factors

def isPrime(n):
	if n & 1 and n >= 2:
		trynum = 3
		limit = ceil(sqrt(n))
		while trynum < limit:
			if n % trynum == 0:
				return False
			trynum += 2
		else:
			return True
	else:
		return False

def nthFib(n):
	if n <= 2:
		return 1
	else:
		(a, b) = (1, 1)
		while n > 2:
			(a, b) = (b, a + b)
			n -= 1
		return b

def zipNWith(f, *x):
	return (f(y) for y in zip(*x))

def zipWith(f, xs, ys):
	return (f(x, y) for (x, y) in zip(xs, ys))

def flatten(xs):
	return reduce(ops.concat, xs)

def quantify(pred, it):
	return sum(map(pred, it))

def dotproduct(xs, ys):
	return sum(map(ops.mul, xs, ys))

def adjpairs(it):
	(a, b) = tee(it)
	next(b, None)
	return zip(a, b)

def bipartition(pred, it):
	(t, f) = tee(it)
	return (filter(pred, t), filterfalse(pred, f))

def powerset(it):
	s = list(it)
	return chain.from_iterable((combos(s, r) for r in range(len(s) + 1)))

def depProduct(bounds, f=lambda y: y + 1, g=lambda *x: tuple(x)):
	args = [-1]
	nbounds = len(bounds)
	while args:
		n = len(args)
		args[-1] += 1
		if args[-1] >= bounds[n - 1]:
			args.pop()
		elif n == nbounds:
			yield g(*args)
		else:
			_f = f[n] if type(f) == list else f
			args.append(_f(args[-1]) - 1)

def revEnumerate(xs):
	n = len(xs) - 1
	for (i, x) in enumerate(reversed(xs)):
		yield (n - i, x)
(nitems, skipat) = getList(int)
costs = getList(int)
incall = sum(costs)
tosplit = incall - costs[skipat]
tosplit /= 2
actual = getVal(int)
if tosplit == actual:
	print('Bon Appetit')
else:
	print(costs[skipat] // 2)


(n, k) = [int(x) for x in input().strip().split(' ')]
arr = [int(x) for x in input().strip().split(' ')]
b = int(input().strip())
anna_cost = int((sum(arr) - arr[k]) / 2)
if b == anna_cost:
	print('Bon Appetit')
else:
	print(b - anna_cost)


(n, k) = [int(i) for i in input().split()]
item = [int(i) for i in input().split()]
ch = int(input())
if (sum(item) - item[k]) // 2 == ch:
	print('Bon Appetit')
else:
	print(abs(ch - (sum(item) - item[k]) // 2))


import sys
(n, k) = [int(i) for i in input().strip().split(' ')]
c = [int(i) for i in input().strip().split(' ')]
b = int(input().strip())
actual_cost = sum(c[:k] + c[k + 1:]) / 2
if b == actual_cost:
	print('Bon Appetit')
else:
	print(int(b - actual_cost))


(n, k) = [int(x) for x in str.split(input())]
costs = [int(x) for x in str.split(input())]
bill_charge = int(input())
if bill_charge == (sum(costs) - costs[k]) / 2:
	print('Bon Appetit')
else:
	print(bill_charge - (sum(costs) - costs[k]) // 2)


def solve():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	c = int(input())
	s = sum(a) - a[k]
	if s // 2 >= c:
		return 'Bon Appetit'
	return c - s // 2
print(solve())


(n, i) = input().strip().split()
(n, i) = [int(n), int(i)]
c = [int(x) for x in input().strip().split()]
cha = int(input().strip())
del c[i]
act = sum(c) / 2
if act == cha:
	print('Bon Appetit')
else:
	print(int(cha - act))


(n, k) = map(int, input().split())
costs = list(map(int, input().split()))
bc = int(input())
diff = bc - (sum(costs) - costs[k]) // 2
if diff == 0:
	print('Bon Appetit')
else:
	print(diff)


tmp = input().split(' ')
n = int(tmp[0])
k = int(tmp[1])
c = list(map(int, input().split(' ')))
r = int(input())
m = int((sum(c) - c[k]) / 2)
if m == r:
	print('Bon Appetit')
else:
	print(r - m)


(n, k) = [int(i) for i in input().strip().split(' ')]
i = [int(i) for i in input().strip().split(' ')]
b = int(input().strip())
actualCost = sum(i) / 2 - i[k] / 2
if b <= actualCost:
	print('Bon Appetit')
else:
	print(int(b - actualCost))


(item_count, k) = [int(x) for x in input().strip().split(' ')]
costs = [int(x) for x in input().strip().split(' ')]
share = int(input().strip())
del costs[k]
split_share = sum(costs) // 2
abs_diff = abs(share - split_share)
if abs_diff == 0:
	print('Bon Appetit')
else:
	print(abs_diff)


(n, k) = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
b = int(input())
s = 0
for i in range(len(c)):
	if i != k:
		s += c[i]
print('Bon Appetit' if s / 2 >= b else b - s // 2)


[n, k] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
z = int(input())
suma = (sum(a) - a[k]) / 2
if suma == z:
	print('Bon Appetit')
else:
	l = 0
	print(int(z - suma))


(n, k) = [int(i) for i in input().split()]
cost = [int(i) for i in input().split()]
charged = int(input())
total = sum(cost)
actual = (total - cost[k]) // 2
if actual == charged:
	print('Bon Appetit')
else:
	print(charged - actual)


info = input().split()
numItems = int(info[0])
allergicItem = int(info[1])
L = [int(x) for x in input().split()]
annaPrice = (sum(L) - L[allergicItem]) // 2
annaPay = int(input())
if annaPay != annaPrice:
	print(annaPay - annaPrice)
else:
	print('Bon Appetit')


(n, k) = map(int, input().split())
costs = list(map(int, input().split()))
asked = int(input())
anna2 = sum(costs) - costs[k]
if anna2 == asked * 2:
	print('Bon Appetit')
else:
	print(int(asked - anna2 / 2))


def main():
	(n, k) = (int(e) for e in input().split())
	costs = [int(e) for e in input().split()]
	b_charged = int(input().strip())
	b_actual = sum([costs[i] for i in range(n) if i != k]) // 2
	if b_charged == b_actual:
		print('Bon Appetit')
	else:
		print(b_charged - b_actual)
main()


(n, k) = input().split()
a = list(map(int, list(input().split())))
add = int(input())
if add == sum(a) // 2 - a[int(k)] // 2:
	print('Bon Appetit')
else:
	print(a[int(k)] // 2)


def main():
	(_, k) = list(map(int, input().strip().split()))
	costs = list(map(int, input().split()))
	charged = int(input())
	owes = (sum(costs) - costs[k]) // 2
	if owes == charged:
		print('Bon Appetit')
	else:
		print(charged - owes)
main()


(n, k) = input().strip().split(' ')
(n, k) = (int(n), int(k))
arr = [int(i) for i in input().strip().split(' ')]
s = sum(arr)
ba = (s - arr[k]) / 2
l = int(input().strip())
if l == ba:
	print('Bon Appetit')
else:
	print(int(l - ba))


(n, k) = input().split()
(n, k) = [int(n), int(k)]
a = [int(x) for x in input().split()]
c = int(input())
d = (sum(a) - a[k]) // 2
print('Bon Appetit' if d == c else c - d)


import math
(N, K) = input().split()
N = int(N)
K = int(K)
cost = input().split()
cost = [int(i) for i in cost]
AnnaBill = int(input())
total = sum(cost)
anna_cost = [c for (index, c) in enumerate(cost) if index != K]
anna_total = sum(anna_cost)
if anna_total / 2 != AnnaBill:
	print(math.floor(abs(AnnaBill - anna_total / 2)))
else:
	print('Bon Appetit')


(n, k) = list(map(int, input().split()))
c = list(map(int, input().split()))
b = int(input().strip())
actual = (sum(c) - c[k]) / 2
if b > actual:
	ans = b - actual
	if ans == int(ans):
		ans = int(ans)
	print(ans)
else:
	print('Bon Appetit')


(n, k) = [int(i) for i in input().split(' ')]
costs = [int(i) for i in input().split(' ')]
charged = int(input())
half = int(sum(costs[:k] + costs[k + 1:]) / 2)
if charged == half:
	print('Bon Appetit')
else:
	print(charged - half)


(n, decline) = map(int, input().strip().split(' '))
prices = list(map(int, input().strip().split(' ')))
charge = int(input().strip())
shared_cost = sum(prices) - prices[decline]
if shared_cost // 2 == charge:
	print('Bon Appetit')
else:
	print(charge - shared_cost // 2)


(n, k) = map(int, input().split())
v = [int(i) for i in input().split()]
b = int(input())
if b != (sum(v) - v[k]) / 2:
	print(int(b - (sum(v) - v[k]) / 2))
else:
	print('Bon Appetit')


(n, k) = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
b = int(input())
total = sum(arr) - arr[k]
if b > total // 2:
	print(b - total // 2)
else:
	print('Bon Appetit')


first = input().split(' ')
second = input().split(' ')
third = int(input())
index = int(first[1])
bill = int(second[index])
sum = 0
for i in second:
	sum += int(i)
sum = sum - bill
sum = int(sum / 2)
if sum - third == 0:
	print('Bon Appetit')
else:
	print(third - sum)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
s1 = int(input())
if s1 == sum(arr) // 2:
	print(arr[k] // 2)
else:
	print('Bon Appetit')


(n, k) = map(int, input().strip().split(' '))
C = list(map(int, input().strip().split(' ')))
b = int(input().strip())
total = sum([C[i] if i != k else 0 for i in range(n)])
if b == total // 2:
	print('Bon Appetit')
else:
	print(b - total // 2)


(n, k) = [int(t) for t in input().strip().split()]
c = [int(t) for t in input().strip().split()]
b = int(input())
total = sum(c)
if total // 2 == b:
	print(c[k] // 2)
else:
	print('Bon Appetit')


(n, k) = list(map(int, input().split()))
price_list = list(map(int, input().split()))
charge = int(input())
Ann_owes = (sum(price_list) - price_list[k]) / 2
if charge == Ann_owes:
	print('Bon Appetit')
else:
	print(int(charge - Ann_owes))


(n, k) = map(int, input().split())
l = [int(x) for x in input().split()]
tot = (sum(l) - l[k]) // 2
q = int(input())
if tot == q:
	print('Bon Appetit')
else:
	print(abs(q - tot))


nk = input().split()
n = int(nk[0])
k = int(nk[1])
s = [int(i) for i in input().split()]
charged = int(input())
cost = 0
for i in range(n):
	cost += s[i]
cost -= s[k]
actual = int(cost / 2)
if charged > actual:
	print(charged - actual)
if charged == actual:
	print('Bon Appetit')


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
charged = int(input())
b = []
for i in range(n):
	if i != k:
		b += [a[i]]
actual = sum(b) // 2
if charged != actual:
	print(charged - actual)
else:
	print('Bon Appetit')


(n, k) = list(map(int, input().split()))
c = list(map(int, input().split()))
b = int(input())
actualMoney = (sum(c) - c[k]) // 2
if actualMoney == b:
	print('Bon Appetit')
else:
	print(abs(b - actualMoney))


def bonappetit(n, k, c, bcharged):
	bactual = (sum(c) - c[k]) / 2
	if bcharged == bactual:
		print('Bon Appetit')
	else:
		print(int(bcharged - bactual))
(n, k) = [int(s) for s in input().split()]
c = [int(s) for s in input().split()]
bcharged = int(input())
bonappetit(n, k, c, bcharged)


(n, k) = input().strip().split()
(n, k) = [int(n), int(k)]
cost = [int(i) for i in input().strip().split()]
charged = int(input().strip())
cost = [cost[i] * (i != k) for i in range(n)]
total = sum(cost) / 2
if total == charged:
	print('Bon Appetit')
else:
	print(int(charged - total))


(n, k) = map(int, input().split())
prices = list(map(int, input().split()))
charge = int(input())
actual_charge = (sum(prices) - prices[k]) // 2
if actual_charge == charge:
	print('Bon Appetit')
else:
	print(charge - actual_charge)


(n, k) = input().split()
cost = list(map(int, input().split(' ')))
charged = int(input())
actual_cost = 0
for index in range(int(n)):
	if index == int(k):
		continue
	actual_cost += cost[index]
actual_cost /= 2
if actual_cost == charged:
	print('Bon Appetit')
else:
	print(int(charged - actual_cost))


nk = [int(a_temp) for a_temp in input().strip().split(' ')]
items = [int(a_temp) for a_temp in input().strip().split(' ')]
cash = input().strip()
items.pop(nk[1])
total = sum(items)
actual = total / 2
if actual == int(cash):
	print('Bon Appetit')
else:
	balance = int(cash) - int(actual)
	print(balance)


(n, k) = map(int, input().split())
x = list(map(int, input().split()))
b = int(input())
sm = sum(x) - x[k]
if sm // 2 == b:
	print('Bon Appetit')
else:
	print(abs(b - sm // 2))


(n, k) = [int(i) for i in input().split(' ')]
foodArr = [int(i) for i in input().split(' ')]
charged = int(input())
totalCost = 0
for i in range(n):
	if not i == k:
		totalCost += foodArr[i]
if int(totalCost / 2) == charged:
	print('Bon Appetit')
else:
	print(charged - int(totalCost / 2))


(n, k) = input().strip().split(' ')
(n, k) = (int(n), int(k))
items = [int(x) for x in input().split()]
actual = int(input().strip())
if (sum(items) - items[k]) / 2 < actual:
	print(int(actual - (sum(items) - items[k]) / 2))
else:
	print('Bon Appetit')


(n, k) = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
b = int(input())
cost = (sum(c) - c[k]) // 2
if b == cost:
	print('Bon Appetit')
else:
	print(b - cost)


(n, k) = input().split()
(n, k) = (int(n), int(k))
c = [int(i) for i in input().strip().split()]
charged = int(input())
c.pop(k)
actual = 0
for i in c:
	actual += i / 2.0
actual = int(actual)
if charged - actual == 0:
	print('Bon Appetit')
else:
	print(charged - actual)


import sys
(n, k) = [int(x) for x in input().strip().split(' ')]
c = [int(x) for x in input().strip().split(' ')]
b = int(input().strip())
assert n == len(c)
c = c[:k] + c[k + 1:]
fair_split = int(sum(c) / 2)
if b == fair_split:
	print('Bon Appetit')
else:
	print(b - fair_split)


(n, k) = (int(i) for i in input().split())
c = [int(i) for i in input().split()]
del c[k]
b_actual = sum(c) // 2
b_charged = int(input())
if b_actual == b_charged:
	print('Bon Appetit')
else:
	print(b_charged - b_actual)


import sys
for (i, line) in enumerate(sys.stdin):
	if i == 0:
		(n, k) = map(int, line.split(' '))
	elif i == 1:
		c = list(map(int, line.split(' ')))
	else:
		charged = int(line)
total = sum(c[:k] + c[k + 1:])
refund = int(charged - total / 2)
if refund > 0:
	print(int(charged - total / 2))
else:
	print('Bon Appetit')


import sys
(n, k) = input().strip().split(' ')
(n, k) = [int(n), int(k)]
prices = list(map(int, input().split()))
charged = input()
charged = int(charged)
shared = 0
count = 0
unshared = 0
for i in prices:
	if count == k:
		unshared = i
	else:
		shared += i
	count += 1
if charged == int(shared / 2):
	print('Bon Appetit')
else:
	print(int(unshared / 2))


(n, k) = [int(c_temp) for c_temp in input().strip().split(' ')]
c = [int(c_temp) for c_temp in input().strip().split(' ')]
b = int(input())
actual = 0
anna_paid = 0
for i in range(len(c)):
	if i != k:
		anna_paid += c[i]
if b == anna_paid // 2:
	print('Bon Appetit')
else:
	print(b - anna_paid // 2)


(n, k) = input().split()
n = int(n)
k = int(k)
p = [int(x) for x in input().split()]
b = int(input())
p.pop(k)
if sum(p) / 2 == b:
	print('Bon Appetit')
else:
	print(int(b - sum(p) / 2))


from functools import reduce
(n, k) = input().strip().split(' ')
(n, k) = (int(n), int(k))
c = [int(i) for i in input().strip().split(' ')]
b = int(input().strip())
c.pop(k)
new_b = b - reduce(lambda x, y: x + y, c) / 2
if int(new_b) == new_b:
	new_b = int(new_b)
print(new_b if new_b else 'Bon Appetit')


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
b = int(input())
total = sum(a) - a[k]
if total >= 2 * b:
	print('Bon Appetit')
else:
	print(b - total // 2)


nck = input()
items = input()
price = int(input())
totalItems = 0
item_lst = items.split(' ')
for item in item_lst:
	totalItems += int(item)
nk = nck.split(' ')
totalItems -= int(item_lst[int(nk[1])])
if totalItems / 2 == price:
	print('Bon Appetit')
else:
	item_charged = int(item_lst[int(nk[1])])
	print(int(item_charged / 2))


import sys
(n, k) = input().strip().split(' ')
(n, k) = [int(n), int(k)]
a = [int(a_temp) for a_temp in input().strip().split(' ')]
pay = int(input().strip())
sum_ = 0
for x in range(0, len(a)):
	if x != k:
		sum_ += a[x]
owe = sum_ / 2
if pay != owe:
	print(int(pay - owe))
else:
	print('Bon Appetit')


import sys
(n, k) = [int(i) for i in sys.stdin.readline().split()]
prices = [int(x) for x in sys.stdin.readline().split()]
charged = int(sys.stdin.readline())
prices.pop(k)
actual = sum(prices) // 2
if actual == charged:
	print('Bon Appetit')
else:
	print(charged - actual)


a = input().split(' ')
b = input().split(' ')
c = input().split(' ')
total_cost = sum([int(i) for i in b])
shareable_cost = total_cost - int(b[int(a[1])])
charged = int(c[0])
if shareable_cost / 2 < charged:
	print(int(charged - shareable_cost / 2))
else:
	print('Bon Appetit')


i = input().split()
(n, k) = (int(i[0]), int(i[1]))
l = list()
i = input().split()
for n in i:
	l.append(int(n))
balance = int(input())
abalance = (sum(l) - l[k]) / 2
if abalance == balance:
	print('Bon Appetit')
else:
	print(int(balance - abalance))


import sys
str = input().split()
n = int(str[0])
k = int(str[1])
list = input().split()
chrge = int(input())
sum = 0
for i in range(n):
	if i != k:
		sum += int(list[i])
sum = sum // 2
if sum == chrge:
	print('Bon Appetit')
else:
	print(chrge - sum)


(n, k) = map(int, input().split())
j = 0
ans = 0
for i in input().split():
	if j != k:
		ans += int(i)
	j += 1
ans = ans // 2
pay = int(input())
if ans == pay:
	print('Bon Appetit')
else:
	print(pay - ans)


(n, k) = input().strip().split()
n = int(n)
k = int(k)
c = [int(i) for i in input().strip().split()]
b_charged = int(input().strip())
c.pop(k)
b_actual = sum(c) / 2
diff = b_charged - b_actual
if diff == 0:
	print('Bon Appetit')
elif diff == int(diff):
	print(int(diff))
else:
	print(diff)


(n, k) = map(int, input().split())
item_cost = list(map(int, input().split()))
charge = int(input())
fair_charge = (sum(item_cost) - item_cost[k]) / 2
if charge == fair_charge:
	print('Bon Appetit')
else:
	print('{}'.format(int(charge - fair_charge)))


(n, k) = map(int, input().strip().split(' '))
a = list(map(int, input().strip().split(' ')))
b = int(input().strip())
c = int((sum(list(a)) - a[k]) / 2)
print('Bon Appetit' if b == c else b - c)


line1 = input()
allergy = -1
if len(line1.split()) == 2:
	allergy = int(line1.split()[1])
items = int(line1.split()[0])
items_list = input().split()
cost = int(input())
brian = 0
anna = 0
for i in range(0, len(items_list)):
	item_cost = int(items_list[i])
	if i == allergy:
		brian += item_cost
	else:
		anna += item_cost / 2.0
		brian += item_cost / 2.0
if cost == anna:
	print('Bon Appetit')
else:
	print(int(round(cost - anna)))


(n, k) = input().strip().split()
(n, k) = [int(n), int(k)]
cost_arr = [int(cost) for cost in input().strip().split()]
bcharged = int(input())
total_cost = sum(cost_arr)
bactual = (total_cost - cost_arr[k]) // 2
if bactual == bcharged:
	print('Bon Appetit')
else:
	print(bcharged - bactual)


first_line = input().split(' ')
(n, k) = (int(first_line[0]), int(first_line[1]))
costs = [int(cost) for cost in input().split(' ')]
anna_paid = int(input())
actual_anna = 0
total = 0
for i in range(n):
	total += costs[i]
actual_anna = int((total - costs[k]) / 2)
if anna_paid == actual_anna:
	print('Bon Appetit')
else:
	print(anna_paid - actual_anna)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
cost = int(input())
if (sum(arr) - arr[k]) // 2 - cost == 0:
	print('Bon Appetit')
else:
	print(cost - (sum(arr) - arr[k]) // 2)


l1 = [int(i) for i in input().split()]
cl = [int(i) for i in input().split()]
c = int(input())
if sum(cl) // 2 == c:
	print(cl[l1[1]] // 2)
else:
	print('Bon Appetit')


(a, b) = [int(x) for x in input().strip().split(' ')]
allData = [int(x) for x in input().strip().split(' ')]
finalCost = int(input())
c = allData[b]
allData.remove(c)
totalCost = 0
for i in allData:
	totalCost += i
totalCostExcess = totalCost / 2 + int(c / 2)
if totalCost / 2 == finalCost:
	print('Bon Appetit')
elif totalCostExcess == finalCost:
	print(int(c / 2))


(n, k) = [int(temp) for temp in input().strip().split()]
c = [int(temp) for temp in input().strip().split()]
bc = int(input().strip())
ba = (sum(c) - c[k]) // 2
if ba != bc:
	print(bc - ba)
	pass
else:
	print('Bon Appetit')
	pass


(n, k) = [int(i) for i in input().strip().split()]
costs = [int(i) for i in input().strip().split()]
charged = int(input().strip())
costs_b = [x for (i, x) in enumerate(costs) if i != k]
tb = sum(costs_b)
t = sum(costs)
if tb / 2 == charged:
	print('Bon Appetit')
else:
	print(int(t / 2 - tb / 2))


(line1, line2, line3) = (input(), input(), input())
n = line1.split(' ')[0]
k = line1.split(' ')[1]
prices = [int(i) for i in line2.split(' ')]
charged = int(line3)
total = 0
for (index, value) in enumerate(prices):
	if str(index) != str(k):
		total += value
diff = charged - total / 2
if diff == 0:
	print('Bon Appetit')
else:
	print(int(diff))


(n, k) = map(int, input().split())
cost = [int(x) for x in input().split()]
b = int(input())
shared = sum(cost) - cost[k]
diff = b - shared // 2
print(diff if diff else 'Bon Appetit')


(n, c) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
paid = int(input())
ans = sum(l)
ans -= l[c]
ans = int(ans / 2)
if ans >= paid:
	print('Bon Appetit')
else:
	print(paid - ans)


(n, k) = tuple((int(x) for x in input().strip().split()))
cost = list((int(x) for x in input().strip().split()))
charge = int(input().strip())
(a, b) = (0, 0)
for i in range(n):
	a += 0 if i == k else cost[i] / 2
	b += cost[i] if i == k else cost[i] / 2
if charge == a:
	print('Bon Appetit')
else:
	print('%d' % (charge - a))


(num, entry) = input().split()
arr = input().split()
cost = int(input())
sum = 0
for i in arr:
	sum = sum + int(i)
share = int((sum - int(arr[int(entry)])) / 2)
if share == int(cost):
	print('Bon Appetit')
else:
	print(cost - share)


(n, k) = [int(x) for x in input().strip().split()]
prices = [int(x) for x in input().strip().split()]
charged = int(input().strip())
tot = (sum(prices) - prices[k]) // 2
if tot == charged:
	print('Bon Appetit')
else:
	print(charged - tot)


n = [int(i) for i in input().strip('').split(' ')]
li = [int(j) for j in input().strip('').split(' ')]
c = int(input().strip(''))
i = n[1]
s = sum(li) - li[i]
if int(s / 2) == c:
	print('Bon Appetit')
else:
	print(int(c - s / 2))


(n, k) = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
bc = int(input())
ba = (sum(c) - c[k]) // 2
if bc == ba:
	print('Bon Appetit')
else:
	print(bc - ba)


(n, k) = map(int, input().split())
items = list(map(int, input().split()))
bill_sum = sum(items)
anna_bill = (bill_sum - items[k]) // 2
b = int(input())
if b == anna_bill:
	print('Bon Appetit')
else:
	print(b - anna_bill)


(n, k) = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
charged = int(input())
s = 0
for i in range(0, n):
	if k != i:
		s += c[i]
correct = s / 2
if correct == charged:
	print('Bon Appetit')
else:
	print(int(charged - correct))


(n, k) = map(int, input().split(' '))
c = list(map(int, input().split(' ')))
b = int(input())
sum_c = sum(c)
sum_c_without = sum_c - c[k]
if sum_c_without / 2 - b == 0:
	print('Bon Appetit')
else:
	print(str(c[k] // 2))


(n, k) = [int(x) for x in input().split()]
prices = [int(x) for x in input().split()]
charge = int(input())
actual = (sum(prices) - prices[k]) / 2
if actual >= charge:
	print('Bon Appetit')
else:
	print(int(charge - actual))


(n, k) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
m = int(input())
ta = sum(l) - l[k]
share = ta / 2
if share == m:
	print('Bon Appetit')
else:
	print(int(abs(share - m)))


(n, k) = map(int, input().split())
cost = [int(x) for x in input().split()]
charge = int(input())
total = sum(cost) - cost[k]
if charge > total / 2:
	print(int(charge - total / 2))
else:
	print('Bon Appetit')


(n, k) = input().split(' ')
(n, k) = [int(n), int(k)]
s = [int(x) for x in input().split()]
pyd = int(input())
r = s[k]
s.remove(r)
shr = int(sum(s) / 2)
if shr == pyd:
	print('Bon Appetit')
else:
	print(pyd - shr)


(_, K) = map(int, input().split())
meal = list(map(int, input().split()))
charged = int(input())
actual = (sum(meal) - meal[K]) // 2
print('Bon Appetit' if charged == actual else charged - actual)


x = input().split(' ')
(a, b) = (int(x[0]), int(x[1]))
l = [int(a) for a in input().split(' ')]
s = sum(l)
ss = s - l[b]
rem = ss // 2
y = int(input())
if y > rem:
	print(y - rem)
else:
	print('Bon Appetit')


(n, k) = map(int, input().split())
c = list(map(int, input().split()))
b = int(input())
b_correct = (sum(c) - c[k]) / 2
if b_correct == b:
	print('Bon Appetit')
else:
	print(int(b - b_correct))


from sys import stdin

def getfromline(s):
	s = s.rstrip()
	s = s.split(' ')
	s = [int(i) for i in s]
	return s

def getdata():
	s = stdin.readline()
	(n, k) = getfromline(s)
	s = stdin.readline()
	c = getfromline(s)
	s = stdin.readline()
	(b,) = getfromline(s)
	return (n, k, c, b)

def run():
	res = 0
	(n, k, c, b) = getdata()
	sm = 0
	for i in c:
		sm += i
	sm -= c[k]
	sm /= 2
	res = int(b - sm)
	if res == 0:
		print('Bon Appetit')
	else:
		print(res)
run()


[n, k] = input().split()
k = int(k)
n = int(n)
costs = [int(a_temp) for a_temp in input().strip().split(' ')]
anna = input()
anna = int(anna)
if anna == sum(costs) / 2 - costs[k] / 2:
	print('Bon Appetit')
else:
	delta = sum(costs) / 2 + costs[k] / 2 - anna
	print('%.0f' % delta)