Daffodil International University
Problem Link
//Please follow from main function
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, k, bil, b, bill[100005], sum=0;
cin>>n>>k;
for(int i=0; i<n; i++)
cin>>bill[i];
cin>>b;
bill[k]=0;
for(int i=0; i<n; i++) sum+=bill[i];
bil=sum/2;
int ll=abs(b-bil);
if(bil==b) cout<<"Bon Appetit"<<endl;
else cout<<ll<<endl;
return 0;
}
0 Comments