You are viewing a single comment's thread. Return to all comments →
#include <math.h> #include <stdio.h> #include <string.h> int main() { long long int n,k,i,arr[100000],b,sum=0,actual; scanf("%lld %lld", &n, &k); for (i=0;i<n;i++) { scanf ("%lld",&arr[i]); } scanf ("%lld",&b); for (i=0;i<n;i++) { sum=sum+arr[i]; } actual=(sum-arr[k])/2; if (b>actual) printf ("%lld",b-actual); else if (b=actual) printf ("Bon Appetit"); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Bill Division
You are viewing a single comment's thread. Return to all comments →