Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 304 Bytes

BoneAppetite.md

File metadata and controls

27 lines (22 loc) · 304 Bytes

#include #include using namespace std; int main() { int n,k,i,b,sum=0,c[10000]; cin>>n; cin>>k; for(i=0;i<n;i++) cin>>c[i]; cin>>b;

for(i=0;i<n;i++) { sum=sum+c[i]; } sum=sum-c[k];

if(b==sum/2) cout<<"Bon Appetit"; else cout<<abs(sum/2-b);

return 0;

}